If your interface has an .on method to register event listeners, it really should support some way to unregister them. And to be consistent with expectations, this should be .off(event, callback).
For example, I'm trying to plug the router into a Kefir stream:
Kefir.fromEvents(this.router, 'navigate')
But the Kefir.fromEvents function will throw an error like this:
Uncaught Error: target don't support any of addEventListener/removeEventListener, addListener/removeListener, on/off method pair
If your interface has an
.on
method to register event listeners, it really should support some way to unregister them. And to be consistent with expectations, this should be.off(event, callback)
.For example, I'm trying to plug the router into a Kefir stream:
But the
Kefir.fromEvents
function will throw an error like this: