@fastkit/visibility
Advanced tools
Comparing version 0.2.1 to 0.2.2
let _hidden = 'hidden'; | ||
let _visibilityChange = 'visibilitychange'; | ||
{ | ||
if ((typeof document !== 'undefined')) { | ||
if (document.hidden !== undefined) { | ||
@@ -26,2 +26,4 @@ _hidden = 'hidden'; | ||
function getVisibilityState() { | ||
if (!(typeof document !== 'undefined')) | ||
return 'hidden'; | ||
return document[HIDDEN] ? 'hidden' : 'visible'; | ||
@@ -46,3 +48,3 @@ } | ||
constructor() { | ||
{ | ||
if ((typeof document !== 'undefined')) { | ||
document.addEventListener(VISIBILITY_CHANGE, (e) => { | ||
@@ -49,0 +51,0 @@ this._setState(getVisibilityState(), e); |
{ | ||
"name": "@fastkit/visibility", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "@fastkit/visibility", | ||
@@ -5,0 +5,0 @@ "buildOptions": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10783
316