Action
Extends:
A unit of work to be executed in a Scheduler. An action is typically created from within a Scheduler and an RxJS user does not need to concern themselves about creating and manipulating an Action.
class Action<T> extends Subscription {
new (scheduler: Scheduler, work: (state?: T) => void);
schedule(state?: T, delay: number = 0): Subscription;
}
Method Summary
| Public Methods | ||
| public |
Schedules this action on its parent Scheduler for execution. |
|
Inherited Summary
| From class Subscription | ||
| public |
A flag to indicate whether this Subscription has already been unsubscribed. |
|
| public |
add(teardown: TeardownLogic): Subscription Adds a tear down to be called during the unsubscribe() of this Subscription. |
|
| public |
remove(subscription: Subscription): void Removes a Subscription from the internal list of subscriptions that will unsubscribe during the unsubscribe process of this Subscription. |
|
| public |
unsubscribe(): void Disposes the resources held by the subscription. |
|
Public Methods
public schedule(state: T, delay: number): void source
Schedules this action on its parent Scheduler for execution. May be passed
some context object, state. May happen at some point in the future,
according to the delay parameter, if specified.
Params:
| Name | Type | Attribute | Description |
| state | T |
|
Some contextual data that the |
| delay | number |
|
Time to wait before executing the work, where the time unit is implicit and defined by the Scheduler. |
Return:
| void |