emit #
Emits an event with the specified payload.
Arguments #
emit(eventName, ...payload);
Argument | Type | Description |
---|---|---|
eventName | string | The name of the event |
payload | any | Payload(s) to send with the event |
Return #
The KuzzleEventEmitter
instance.
Usage #
const eventEmitter = new KuzzleEventEmitter();
eventEmitter.addListener('helloEvent', msg => console.log(`Hello ${msg}`));
eventEmitter.emit('helloEvent', 'World');
Edit this page on Github(opens new window)