Skip to content

Commit 89e9088

Browse files
committed
fix: onWindowFocus leak
1 parent 74cf418 commit 89e9088

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/app/utils/window.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
const windowFocusHook = createEventHook<void>()
2-
3-
useEventListener('focus', () => {
4-
windowFocusHook.trigger()
5-
})
6-
7-
export const onWindowFocus = windowFocusHook.on
1+
export function onWindowFocus(cb: () => unknown) {
2+
useEventListener('focus', cb)
3+
}

0 commit comments

Comments
 (0)