Skip to content
0

katanakit-js / useIsBrowser

Function: useIsBrowser() ​

ts
function useIsBrowser(): boolean;

Defined in: src/infrastructure/dom/dom.service.ts:27

Checks whether the code is running in a browser environment.

Returns ​

boolean

true if both window and document are defined.

Example ​

ts
if (useIsBrowser()) {
  // safe to access DOM APIs
}

Released under the MIT License.