Skip to main content

Interface: useDispatcherType

@ima/react-page-renderer.useDispatcherType

Properties

fire

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

Type declaration

▸ <E>(event, data, imaInternalEvent?): 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.

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.
imaInternalEvent?booleanThe flag signalling whether this is an internal IMA event. The fired event is treated as a custom application event if this flag is not set. The flag is used only for debugging and has no effect on the propagation of the event.
Returns

Dispatcher

This dispatcher.

▸ (event, data, imaInternalEvent?): Dispatcher

Parameters
NameType
eventstring
dataany
imaInternalEvent?boolean
Returns

Dispatcher

Defined in

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