UNPKG

react-dayo

Version:

A Queue component for notification etc

29 lines (28 loc) 781 B
import { DispatcherImpl, DispatcherEventFn } from './interfaces'; import { Event } from './constants/events'; /** * Dispatcher Use Case for seed */ export declare class Dispatcher implements DispatcherImpl { private events; /** * To turn AsyncIterable that obtained form the factory. */ dispatch: (builder: { seed: { issue(): AsyncIterable<unknown> & { values: any; }; }; values: any; }) => () => Promise<void>; /** * To fire callback function for the event that is registered */ emit(event: Event, yielded: unknown): void; /** * To register callback function for the event */ on(event: Event, cb: DispatcherEventFn): void; } export default Dispatcher;