/** * Method to unbind event listeners once they have been registered. * @param {string} event - the event name. * @param {KolibriModule} kolibriModule - object of KolibriModule class * @param {string} method - the name of the method of the KolibriModule object. */ stopListening(event, kolibriModule, method) { // Allow an event to be unlistened to. const callback = ((this._callbackRegistry[kolibriModule.name] || {})[event] || {})[method]; if (typeof callback !== 'undefined') { this._eventDispatcher.$off(event, callback); delete this._callbackRegistry[kolibriModule.name][event][method]; } }
/** * Proxy to the Vue object that is the global dispatcher. * Takes any arguments and passes them on. */ off(...args) { this._eventDispatcher.$off(...args); }
(this._asyncCallbackRegistry[kolibriModule.name] || []).forEach((async) => { this._eventDispatcher.$off(async.event, async.callback); });
off: () => EventBus.$off(event, callback),