Skip to content

Instantly share code, notes, and snippets.

@MarsiBarsi
Last active March 23, 2021 14:50
Show Gist options
  • Select an option

  • Save MarsiBarsi/118c6aedb0ea7c80cdd3ecfa08d61bfb to your computer and use it in GitHub Desktop.

Select an option

Save MarsiBarsi/118c6aedb0ea7c80cdd3ecfa08d61bfb to your computer and use it in GitHub Desktop.

Revisions

  1. MarsiBarsi revised this gist Mar 23, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions rxjs-challenge.ts
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    const pageVisibility$ = fromEvent(documentRef, 'visibilitychange').pipe(
    startWith(0),
    map(() => documentRef.visibilityState !== 'hidden'),
    distinctUntilChanged(),
    );
  2. MarsiBarsi created this gist Mar 23, 2021.
    4 changes: 4 additions & 0 deletions rxjs-challenge.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    const pageVisibility$ = fromEvent(documentRef, 'visibilitychange').pipe(
    startWith(0),
    map(() => documentRef.visibilityState !== 'hidden'),
    );