kevinabouhanna/abouhanna

R&D - Technical Debt: use setTimeout proper alternative

Opened this issue · 1 comments

check about using this event listener document.addEventListener('visibilitychange',function(){} );

An example of how I have implemented this feature can be found here https://github.com/gk-git/gabykaram/blob/main/src/components/Global/CurrentlyPlaying/CurrentlyPlaying.tsx.

But I took a simple decision to not run the API call when the tab isn't active