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

[question] off(*) behaviour #70

Closed
Andarist opened this issue Dec 11, 2017 · 1 comment
Closed

[question] off(*) behaviour #70

Andarist opened this issue Dec 11, 2017 · 1 comment

Comments

@Andarist
Copy link
Contributor

Andarist commented Dec 11, 2017

shouldnt it remove all listeners instead of only listeners attached with on('*', fn)? alternatively it would be good to have some destroy method to remove all listeners, whatsoever, that could be even achieved with emitter.off() (when called without arguments)

@developit
Copy link
Owner

No - wildcards are an event type of their own, they simply match all fired events. If the behavior was changed, it'd make it impossible to unregister a * listener. Your other suggestion was discussed here, and there are a few different solutions provided that don't require extra code in mitt:
#27

This was referenced Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants