Skip to main content

hooks/useEventListener

Functions

useEventListener()

Call Signature

function useEventListener<K>(
target,
event,
handler,
options?): VoidFunction;

Defined in: hooks/useEventListener.ts:8

Type Parameters
Type Parameter
K extends keyof DocumentEventMap
Parameters
ParameterType
targetTarget
eventK
handler(event) => void
options?Options
Returns

VoidFunction

Call Signature

function useEventListener<K>(
target,
event,
handler,
options?): VoidFunction;

Defined in: hooks/useEventListener.ts:14

Type Parameters
Type Parameter
K extends keyof WindowEventMap
Parameters
ParameterType
targetTarget
eventK
handler(event) => void
options?Options
Returns

VoidFunction

Call Signature

function useEventListener<K>(
target,
event,
handler,
options?): VoidFunction;

Defined in: hooks/useEventListener.ts:20

Type Parameters
Type Parameter
K extends keyof GlobalEventHandlersEventMap
Parameters
ParameterType
targetTarget
eventK
handler(event) => void
options?Options
Returns

VoidFunction