arqex / fluxify

The simplest Flux implementation.
GNU General Public License v2.0
101 stars 5 forks source link

Error in xEmitter.off #7

Closed rlamorea closed 8 years ago

rlamorea commented 8 years ago

You are not able to turn off a handler due to a bug on line 45:

44 for (i = listeners.length - 1; i >= 0; i--) { 45 if( listeners[i] === listener ) 46 listeners.splice( i, 1 ); 47 }

Since the handler is pushed in as { callback: listener, once: once } the check needs to be for listeners[i].callback.

ducman commented 8 years ago

+1, just found this out as well.

arqex commented 8 years ago

Thanks for the feedback. I'll try to fix it this evening :)

arqex commented 8 years ago

Fixed in v0.2.3, thanks for your accurate comments.

rlamorea commented 8 years ago

Thanks! (And minor thing: the bower.json still shows version as 0.2.2)