Skip to content

Commit

Permalink
feat(page-visibility): document.hidden -> document.visibilityState (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarsiBarsi authored Mar 23, 2021
1 parent bc61bf5 commit 244ede0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion projects/common/src/tokens/page-visibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const PAGE_VISIBILITY = new InjectionToken<Observable<boolean>>(

return fromEvent(documentRef, 'visibilitychange').pipe(
startWith(0),
map(() => !documentRef.hidden),
map(() => documentRef.visibilityState !== 'hidden'),
distinctUntilChanged(),
share(),
);
Expand Down

0 comments on commit 244ede0

Please sign in to comment.