Skip to content

Commit

Permalink
fix: onWindowFocus leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Nov 18, 2024
1 parent 74cf418 commit 89e9088
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/app/utils/window.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
const windowFocusHook = createEventHook<void>()

useEventListener('focus', () => {
windowFocusHook.trigger()
})

export const onWindowFocus = windowFocusHook.on
export function onWindowFocus(cb: () => unknown) {
useEventListener('focus', cb)
}

0 comments on commit 89e9088

Please sign in to comment.