clean up event listeners in proxy (#50)

This commit is contained in:
Lynn
2017-03-30 16:20:51 -07:00
committed by GitHub
parent 7989bcc044
commit 7ee0418c82
5 changed files with 57 additions and 18 deletions

View File

@@ -37,7 +37,6 @@ class Notify {
function onClick(arg) {
if (arg.id === this._id) {
this.emitter.emit('click');
arg.closeNotification();
}
}
@@ -92,9 +91,9 @@ class Notify {
//
destroy() {
this.emitter.removeAllListeners();
// allow live instance to be destroyed
this.emitter.emit('destroy');
this.emitter.removeAllListeners();
}
}