SDK
SDK Javascript v7.x
2

emit #

Emits an event with the specified payload.

Arguments #

emit(eventName, ...payload);

ArgumentTypeDescription
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');