SDK
SDK Javascript v6.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

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