UNPKG

rc-hooks

Version:
17 lines (16 loc) 524 B
"use strict"; 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; }