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

Support .callHookOnce #105

Open
1 task
pi0 opened this issue Oct 22, 2024 · 0 comments
Open
1 task

Support .callHookOnce #105

pi0 opened this issue Oct 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@pi0
Copy link
Member

pi0 commented Oct 22, 2024

Describe the feature

Usually, there are some hooks that are to be called only once.

In the current API, it is delegated to hook consumers to use hookOnce on them; if they don't and use hook insteam, small callbacks might remain in memory.

A new .callHookOnce API can make sure it from provider-side and automatically discard all listeners after.

Second idea: We could also warn if a hook register attempt after callOnce that it won't be called and likely a late register issue

Additional information

  • Would you be willing to help implement this feature?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant