Skip to content

Commit

Permalink
in ssr mode return early
Browse files Browse the repository at this point in the history
  • Loading branch information
joetannenbaum committed Jan 15, 2025
1 parent b81f8f9 commit 5125df4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ export class Router {
type: TEventName,
callback: (event: GlobalEvent<TEventName>) => GlobalEventResult<TEventName>,
): VoidFunction {
if (typeof window === 'undefined') {
return () => {}
}

return eventHandler.onGlobalEvent(type, callback)
}

Expand Down

0 comments on commit 5125df4

Please sign in to comment.