UseIsBrowser
katanakit-js / useIsBrowser
Function: useIsBrowser()
Section titled “Function: useIsBrowser()”function useIsBrowser(): boolean;Defined in: infrastructure/dom/dom.service.ts:27
Checks whether the code is running in a browser environment.
Returns
Section titled “Returns”boolean
true if both window and document are defined.
Example
Section titled “Example”if (useIsBrowser()) { // safe to access DOM APIs}