Class: Action

core.Action

Base class representing an abstract action.

An action runs when started and finishes after some time, emitting the begin and finish events.

Derived classes must implement the start() method, which must call start() from this superclass. After the derived action finished, it must emit the finish event.

new core.Action ()

Properties:
Name Type Description
busy bool

[readonly] true while the action is running.

enabled bool

(default: true) If false this action is skipped.

status string

[readonly] The current status. One of idle|running|stopping

Extends

Methods

start ()Promise

Starts the action and returns a Promise.

Returns:
Type Description
Promise A Promise that resolves when the animation finished.

stop ()

Requests the action to stop and returns a promise that resolves when stopped. Subclasses must monitor the status property for the stopping status and act accordingly.

Events

core.Action.event:begin

Is triggered when the action begins.

core.Action.event:finish

Is triggered when the action finishes.