10 lines
210 B
JavaScript
10 lines
210 B
JavaScript
|
export function pageVisibilityObservers (store) {
|
||
|
if (!process.browser) {
|
||
|
return
|
||
|
}
|
||
|
|
||
|
document.addEventListener('visibilitychange', () => {
|
||
|
store.set({pageVisibilityHidden: document.hidden})
|
||
|
})
|
||
|
}
|