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
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
hookOnceon them; if they don't and usehookinsteam, small callbacks might remain in memory.A new
.callHookOnceAPI 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