Skip to content

Commit

Permalink
fix: kwArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Jun 26, 2023
1 parent 180c12c commit 31db135
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,16 @@ export function useEventListener<
element: HTMLElement,
type: EventType,
listener: (this: HTMLElement, ev: HTMLElementEventMap[EventType]) => any,
{
options,
deps = []
}: {
kwArgs: {
options?: boolean | AddEventListenerOptions,
deps?: DependencyList
}
} = {}
): void {
const {
options,
deps = []
} = kwArgs;

useEffect(() => {
element.addEventListener(type, listener, options);

Expand Down

0 comments on commit 31db135

Please sign in to comment.