radiocampus: style update

This commit is contained in:
2024-05-31 14:40:31 +02:00
parent a323901d0e
commit f29cced5f5
66 changed files with 10589 additions and 10 deletions

View File

@ -0,0 +1,17 @@
/**
* Run function with provided args only if document is not hidden
*/
export function setEcoTimeout(func, ...args) {
return setTimeout((...args) => {
!document.hidden && func(...args)
}, ...args)
}
/**
* Run function at specific interval only if document is not hidden
*/
export function setEcoInterval(func, ...args) {
return setInterval((...args) => {
!document.hidden && func(...args)
}, ...args)
}