useGuthrieEventsCallback()
ts
function useGuthrieEventsCallback(target, events): UseGuthrieEventsCallbackReturn;Defined in: hooks/event.ts:33
Creates a callback that attaches event listeners to a target.
This hook returns a function that, when executed, registers all provided events on the given target using addListener.
Parameters
| Parameter | Type | Description |
|---|---|---|
target | RefObject<string | HTMLElement | Window | null> | Target element, window, or reference Renderer |
events | ExposableEvent[] | undefined | List of exposable events to attach |
Returns
UseGuthrieEventsCallbackReturn
Callback function that registers the event listeners
Remarks
- Does not automatically attach listeners
- Intended to be used in controlled lifecycle scenarios
Since
1.0.0
Author
Simon Kovtyk