UNPKG

@rarible/action

Version:

Action is almost like async function, but actions can be divided into steps. It gives more control over action execution.

17 lines (16 loc) 448 B
export type Step<Id, T, R> = { id: Id; run: (value: T) => Promise<R>; }; export declare class Execution<Id, T> { private readonly input; private readonly steps; private readonly state; private readonly promises; constructor(input: any, steps: Step<unknown, unknown, unknown>[]); get ids(): Id[]; runAll(): Promise<T>; run(idx: number): Promise<void>; private runInternal; get result(): Promise<T>; }