Just wondering if there are any consideration to be taken into account when calling lifecycle functions like
onMount
onMount
or
onCleanup
onCleanup
inside some abstracted function made to reuse code, like a hook in react.
Would it work fine so long as the function gets called in a component, or anything else to keep in mind? And is this something inline with what custom directives like
use
use
are designed for, or its unrelated?
For context in my specific situation would like to register global event listeners for