Does anybody know if there's an event listener which detects when a service worker is about to become inactive? Something like:
self.addEventListener('inactive', (event) =>
{
// Random piece of code here
}
Reason being is that I want to save data to storage before it becomes inactive since the data gets removed once it becomes inactive.