Spaces:
Sleeping
Sleeping
Download node_modules/@reduxjs/toolkit/src/query/utils/isDocumentVisible.ts from Scribbler310/gs-port: direct link, hf CLI and curl.
- Browser
- Download file 427 Bytes
-
https://huggingface.co/spaces/Scribbler310/gs-port/resolve/main/node_modules/%40reduxjs/toolkit/src/query/utils/isDocumentVisible.ts
- Command line
-
hf download hf://spaces/Scribbler310/gs-port/node_modules/@reduxjs/toolkit/src/query/utils/isDocumentVisible.ts
-
curl -L -o isDocumentVisible.ts https://huggingface.co/spaces/Scribbler310/gs-port/resolve/main/node_modules/%40reduxjs/toolkit/src/query/utils/isDocumentVisible.ts
427 Bytes
| /** | |
| * Assumes true for a non-browser env, otherwise makes a best effort | |
| * @link https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState | |
| */ | |
| export function isDocumentVisible(): boolean { | |
| // `document` may not exist in non-browser envs (like RN) | |
| if (typeof document === 'undefined') { | |
| return true | |
| } | |
| // Match true for visible, prerender, undefined | |
| return document.visibilityState !== 'hidden' | |
| } | |