Test case:
const emitter = dush()
const handler1 = () => { console.log('a') }
const handler2 = () => { console.log('a') }
emitter.on('a', handler1)
emitter.on('a', handler2)
emitter.off('a', handler1)
What is expected?
handler2 should not be removed
What is actually happening?
handler2 is removed because the lib uses fn.toString() to identify a function and source code of both functions looks the same
Test case:
What is expected?
handler2 should not be removed
What is actually happening?
handler2 is removed because the lib uses fn.toString() to identify a function and source code of both functions looks the same