start on custom server

This commit is contained in:
MapleLeaf
2022-01-02 23:36:50 -06:00
committed by Darius
parent 14450cc743
commit 41a22175e3
30 changed files with 2257 additions and 33 deletions

View File

@@ -0,0 +1,11 @@
import { useEffect } from "react"
export function useWindowEvent<EventType extends keyof WindowEventMap>(
type: EventType,
handler: (event: WindowEventMap[EventType]) => void,
) {
useEffect(() => {
window.addEventListener(type, handler)
return () => window.removeEventListener(type, handler)
})
}