-
Notifications
You must be signed in to change notification settings - Fork 481
Closed
Description
Hello,
should there be a method to remove all listeners of the emitter, to save performance?
I have an example case when we initialize a component, and the component needs to use the event emitter, and pass it to other function to listen to the component event:
// component.js
componentInit() {
method.init(emitter);
}
// method.js
init (emitter) {
emitter.on('something', doSomething);
}Then, when the component is about to be destroyed, should the emitter be "cleaned up" so the method won't have to preserve the event listener anymore? For ex:
// component.js
componentDestroy() {
emitter.off('*');
}Metadata
Metadata
Assignees
Labels
No labels