Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.off() is not working properly for listeners added by .once() #8

Closed
aishikaty opened this issue Mar 17, 2017 · 2 comments
Closed

.off() is not working properly for listeners added by .once() #8

aishikaty opened this issue Mar 17, 2017 · 2 comments

Comments

@aishikaty
Copy link

This doesn't seem to work as expected:

const emitter = dush()
const hello = () => console.log("You shouldn't see this.")
emitter.once('test', hello)
emitter.off('test', hello)
emitter.emit('test')
@tunnckoCore
Copy link
Member

Interesting. More and more bugs with that implemantation of .off. I think #7 is related to it too.

@tunnckoCore tunnckoCore added this to the v3 milestone Mar 17, 2017
@tunnckoCore
Copy link
Member

Actually, @aishikaty, it not make much sense to off something that is added by once because it is offed by default, internally. That's the whole point of once.\

Nevermind, i got your logic, and it I fixed that, so now it is working. I'm going to push fixes in a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants