fluxDispatcher
caution
All props/parameters are optional unless they are marked with an asterisk ( * ).
Functions
Name | Parameters | Return Type | Description |
---|---|---|---|
addDependencies | * token : string * tokens : string[] | void | Adds a dependency |
addInterceptor | * callback : (...rest: unknown[]) => unknown | void | Adds an interceptor |
createToken | string | Creates a token | |
dispatch | * action : { type: string, [index: string]: unknown } | void | Broadcasts payloads to registered callbacks |
flushWaitQueue | void | Flushes the waiting queue | |
isDispatching | boolean | Checks if something is already dispatching | |
register | * name : string * actionHandler : Record<string, (action?: { [index: string]: unknown }) => void> * storeDidChange : { type: string, [index: string]: unknown } * band : DispatchBand token : string | string | Registers a callback |
subscribe | * type : string * callback : (action?: { [index: string]: unknown }) => void | void | Subscribes to a new action |
unsubscribe | * type : string * callback : (action?: { [index: string]: unknown }) => void | void | Unsubscribes from an action |
wait | * callback : (...rest: unknown[]) => unknown | void | Adds a callback to the wait queue |