Destroy a hook
Whenever you add a hook in the store, it always returns a HookLink
instance that represents the link between the hook and store. You can destroy this link anytime you want to stop the hook from listening on state changes.
The returned HookLink
instance is only available inside the hook callback after the initial phase.
your-controller.ts
Another method of HookLink
is destroyOn
. You can use this method if you want to destroy a hook automatically. The only requirement is a scope
where hook
should be bound. When a scope triggers a $destroy
event, the hook also gets destroyed.
your-controller.ts
Last updated