Skip to main content

Interface: useDispatcherType

@ima/react-page-renderer.useDispatcherType

Properties

fire

fire: <E>(event: E, data: DispatcherEventsMap[E]) => Dispatcher(event: string, data: any) => Dispatcher

Type declaration

▸ <E>(event, data): Dispatcher

Fires a new event of the specified name, carrying the provided data.

The method will synchronously execute all event listeners registered for the specified event, passing the provided data to them as the first argument.

It will also execute all event listeners registered to listen to all events.

Note that this method does not prevent the event listeners to modify the data in any way. The order in which the event listeners will be executed is unspecified and should not be relied upon.

Type parameters
NameType
Eextends keyof DispatcherEventsMap
Parameters
NameTypeDescription
eventEThe name of the event to fire.
dataDispatcherEventsMap[E]The data to pass to the event listeners.
Returns

Dispatcher

This dispatcher.

▸ (event, data): Dispatcher

Parameters
NameType
eventstring
dataany
Returns

Dispatcher

Defined in

packages/react-page-renderer/src/hooks/dispatcher.ts:12