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.

listeners #

Returns the listener functions bound to a specific event.

Arguments #

Copied to clipboard!
listeners(eventName);

Return #

An array of listener functions.

Usage #

Copied to clipboard!
const eventEmitter = new KuzzleEventEmitter();
eventEmitter.addListener('myEvent', () => console.log('Hello'));
eventEmitter.addListener('myEvent', () => console.log('Hello World'));
const listeners = eventEmitter.listeners('myEvent');
console.log(`There are ${listeners.length} listeners bound to the event "myEvent"`);