-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: allow removing registered hooks #16
Conversation
This will also return a `unregister` function allowing to write code like this (basically an equivalent of "once"): ```js const unreg = hable.hook('some:event', () => { console.log('do stuff') unref() }) ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR ❤️
Also would be great if you can help adding tests to cover unregister
Thank you @matthieusieben for this PR, after talking with @pi0, it looks good now! Could you please update the README to reflect the changes this PR brings? Also, there is a conflict regarding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thanks!
This will also return a
unregister
function allowing to write code like this (basically an equivalent of "once"):