this.evt_emitter_.off(eventName, this.addons_listeners[listener]);
delete this.addons_listeners[listener];
} else console.log('Listener is not registered');
+ },
+ once: (eventName, listener) => {
+ if (EventList.indexOf(eventName) === -1) {
+ console.log(`Invalid Event: ${eventName}`);
+ } else if (!this.addons_listeners[listener]) {
+ console.log(`A new one-time listener for ${eventName} is added`);
+ this.evt_emitter_.once(eventName, getSafeFunction(listener));
+ } else console.log('Listener is already registered for the multiple-time use');
}
}
}