You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-tools/src/hooks/useEventListener.ts
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ import { useMemoizedFunction } from ".";
4
4
/**
5
5
* __`useEventListener`__: Hook to simplify add and remove EventListener use. It's persist during rerendering and automatically remove eventlistener on unMount component lifecycle.
6
6
* @param {Object} options
7
-
* @param {string} options.type - event type
8
-
* @param {(evt: Event | CustomEvent) => void} options.listener - listener to be executed on specified event
9
-
* @param {RefObject<HTMLElement> | Window} [options.element=window] - element on which attaching eventListener
10
-
* @param {boolean | AddEventListenerOptions} [options.listenerOpts] - options for listener
7
+
* @param {string} options.type - event type.
8
+
* @param {(evt: Event | CustomEvent) => void} options.listener - listener to be executed on specified event.
9
+
* @param {RefObject<HTMLElement> | Window} [options.element=window] - element on which attaching eventListener.
10
+
* @param {boolean | AddEventListenerOptions} [options.listenerOpts] - options for listener.
11
11
* @param {"normal"|"layout"} [options.effectType="normal"] - option to set which hook is used to attach event listener.
12
12
* @returns {()=>void} remove - used to manually remove the eventListener, otherwise is removed when component is unmounted.
0 commit comments