UNPKG

1.33 kBTypeScriptView Raw
1import { Scheduler } from '../Scheduler';
2import { Subscription } from '../Subscription';
3import { SchedulerAction } from '../types';
4/**
5 * A unit of work to be executed in a `scheduler`. An action is typically
6 * created from within a {@link SchedulerLike} and an RxJS user does not need to concern
7 * themselves about creating and manipulating an Action.
8 *
9 * ```ts
10 * class Action<T> extends Subscription {
11 * new (scheduler: Scheduler, work: (state?: T) => void);
12 * schedule(state?: T, delay: number = 0): Subscription;
13 * }
14 * ```
15 *
16 * @class Action<T>
17 */
18export declare class Action<T> extends Subscription {
19 constructor(scheduler: Scheduler, work: (this: SchedulerAction<T>, state?: T) => void);
20 /**
21 * Schedules this action on its parent {@link SchedulerLike} for execution. May be passed
22 * some context object, `state`. May happen at some point in the future,
23 * according to the `delay` parameter, if specified.
24 * @param {T} [state] Some contextual data that the `work` function uses when
25 * called by the Scheduler.
26 * @param {number} [delay] Time to wait before executing the work, where the
27 * time unit is implicit and defined by the Scheduler.
28 * @return {void}
29 */
30 schedule(state?: T, delay?: number): Subscription;
31}
32//# sourceMappingURL=Action.d.ts.map
\No newline at end of file