Skip to main content

fluxDispatcher

caution

All props/parameters are optional unless they are marked with an asterisk ( * ).

Functions

NameParametersReturn TypeDescription
addDependencies* token: string
* tokens: string[]
voidAdds a dependency
addInterceptor* callback: (...rest: unknown[]) => unknownvoidAdds an interceptor
createTokenstringCreates a token
dispatch* action: { type: string, [index: string]: unknown }voidBroadcasts payloads to registered callbacks
flushWaitQueuevoidFlushes the waiting queue
isDispatchingbooleanChecks 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
stringRegisters a callback
subscribe* type: string
* callback: (action?: { [index: string]: unknown }) => void
voidSubscribes to a new action
unsubscribe* type: string
* callback: (action?: { [index: string]: unknown }) => void
voidUnsubscribes from an action
wait* callback: (...rest: unknown[]) => unknownvoidAdds a callback to the wait queue