feat: upgrade fresh
This commit is contained in:
@@ -3,7 +3,7 @@ import { useEffect, useRef } from "preact/hooks";
|
||||
export function useEventListener<T extends Event>(
|
||||
eventName: string,
|
||||
handler: (event: T) => void,
|
||||
element: Window | HTMLElement = window,
|
||||
element: Window | HTMLElement = globalThis,
|
||||
) {
|
||||
// Create a ref that stores handler
|
||||
const savedHandler = useRef<(event: Event) => void>();
|
||||
|
Reference in New Issue
Block a user