rc-hooks
Version:
React Hooks Library.
17 lines (16 loc) • 524 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDocumentVisible = isDocumentVisible;
exports.isOnline = isOnline;
function isDocumentVisible() {
if (typeof document !== 'undefined' && typeof document.visibilityState !== 'undefined') {
return document.visibilityState !== 'hidden';
}
return true;
}
function isOnline() {
if (typeof navigator !== 'undefined' && typeof navigator.onLine !== 'undefined') {
return navigator.onLine;
}
return true;
}