chore: actually clean out events/namespaces
This commit is contained in:
parent
f26c9f7fd3
commit
3d18d010f2
|
@ -120,8 +120,19 @@ export function EventEmitterMixin(Superclass) {
|
|||
listeners[type] = listeners[type].filter((listener) => {
|
||||
return listener.fn !== fn;
|
||||
});
|
||||
if (0 === listeners[type].length) {
|
||||
delete listeners[type];
|
||||
}
|
||||
});
|
||||
|
||||
if (
|
||||
(namespace in this.$$namespaces)
|
||||
) {
|
||||
if (0 === Object.keys(this.$$namespaces[namespace]).length) {
|
||||
delete this.$$namespaces[namespace];
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user