UNPKG

sanity

Version:

Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches

8 lines (6 loc) 262 B
import {EMPTY, fromEvent, type Observable} from 'rxjs' import {shareReplay} from 'rxjs/operators' export const visibilityChange$: Observable<Event> = typeof window === 'undefined' ? EMPTY : fromEvent(document, 'visibilitychange').pipe(shareReplay(1))