UNPKG

rc-hooks

Version:
13 lines (12 loc) 385 B
export function isDocumentVisible() { if (typeof document !== 'undefined' && typeof document.visibilityState !== 'undefined') { return document.visibilityState !== 'hidden'; } return true; } export function isOnline() { if (typeof navigator !== 'undefined' && typeof navigator.onLine !== 'undefined') { return navigator.onLine; } return true; }