pageVisibility

import { pageVisibility } from '@hullo/browser'

An Observable of string values that are emitted with visibilitychange event.

import { pageVisibility } from '@hullo/browser';
const visibility$ = pageVisibility();
visibility$.subscribe({
next(visibility) {
switch(visibility) {
case "prerender":
console.log('where are you?');
break;
case "hidden":
console.log('peeka');
break;
case "visible":
console.log('boo');
break;
}
}
})