Closed Easy-Martin closed 6 years ago
It is expected to use the same handler reference when unbinding events.
let callback = () => { this.callback2() }
event.on('aaa', callback)
event.off('aaa', callback)
ok,but there are problems when linstener is undefined
this._events[event].splice(-1,1 )
shouldn't it be like this?
var index = this._events[event].indexOf(listener)
index !== -1 && this._events[event].splice(index, 1);