feat: some shit

This commit is contained in:
2023-08-08 11:03:20 +02:00
parent eb1d065f1f
commit dccb6a6ecf
9 changed files with 95 additions and 19 deletions

View File

@ -3,7 +3,7 @@ import { useEffect, useRef } from "preact/hooks";
export function useEventListener<T extends Event>(
eventName: string,
handler: (event: T) => void,
element = window,
element: Window | HTMLElement = window,
) {
console.log("Add Eventlistener", { eventName, element, handler });
// Create a ref that stores handler