Kelin2025 / vue-timers

Mixin to manage your intervals in Vue.js
MIT License
231 stars 17 forks source link

Feature Request: pause/start timer when the page visibility changes #51

Open paolobarbolini opened 5 years ago

paolobarbolini commented 5 years ago

The Page Visibility API is especially useful for saving resources and improving performance by letting a page avoid performing unnecessary tasks when the document isn't visible.

https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API

One of the unnecessary tasks which in many apps could be avoided is running a timer when the page isn't even visible.

I'm willing to send a pull request later if you are interested in having this in the library.

masongzhi commented 4 years ago

I think this is not the accusation of this tool, you can achieve it on your own project.