Skip to content

Commit 8956c7e

Browse files
committed
add service ti check if running on client
1 parent 42f790c commit 8956c7e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// @flow
2+
3+
4+
/**
5+
* Check if currently running in the browser or not
6+
* -> useful for server side rendering
7+
*
8+
* @returns {boolean}
9+
*/
10+
export function isBrowserSide(): boolean {
11+
return typeof window === 'object';
12+
}
13+

0 commit comments

Comments
 (0)