Open RaedKhalafDAZN opened 11 months ago
What do you mean by “access to the current active listeners”? What exactly expected from access to the list of functions?
@parfeon I mean, we have in listernes_manager.js all sort of functions to CUD listeners, but we are missing Read of the current listeners.
in listeners_manager.js
removeAllListeners() {
this._listeners = [];
}
// Added
getAllListeners() {
return this._listeners;
}
In Reactive JS application, we need to react to certain types of events in different parts of the application, when we call "AddListener" to pubnub, we need to make sure its not already added before.
because it will create duplicate messages to the platform.
@RaedKhalafDAZN thank you for clarification.
This listener stores listeners created at some point and then re-use them when you want to register? If they are the same function objects (during repetitive registration and removal), then from our side we can try to validate whether the listener already added or not.
Hi @parfeon, that would be great! can we have a timeline to do that ? I can contribute to support this.
@parfeon any updates ?
@RaedKhalafDAZN i apologize for long response. We will make enhancement in upcoming release (end of this week or start of the next)
Currently, we are using Pubnub.addListener get get access to messages streams,
but, due to multiple channels subscriptions in different parts of the application, we would like to get access to the current active listeners,
and maybe we can add UUID identifiers for each listeners.