I am using the page visibility api in my app. I need the value of document.hidden
to update reactively.
I have a template that when rendered I check if the page is visible and if it is then I set a document property to false
. Now if the page isn't visible I do want to set the property to false when it does come into view. How should I do this? I tried the template autorun block but it didn't work.
Ok so apparently I was using document.hidden
and not a event listener. I fixed it.