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
Name | Type |
---|---|
E | extends keyof DispatcherEventsMap |
Parameters
Name | Type | Description |
---|---|---|
event | E | The name of the event to fire. |
data | DispatcherEventsMap [E ] | The data to pass to the event listeners. |
Returns
This dispatcher.
▸ (event
, data
): Dispatcher
Parameters
Name | Type |
---|---|
event | string |
data | any |