Re: [w3c/ServiceWorker] New "setup" lifecycle for service worker (#1576)

Above snippet is current implementation without "setup" phase.

If service worker support "setup" phase, the snippet will look like below, very simple:

```
var cache;

self.addEventListener('setup', event => {
  cache = await readDataFromStorage();
});

chrome.tabs.onUpdated.addListener(function(parameters) {
  // use cache data process events
});
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1576#issuecomment-814218129

Received on Tuesday, 6 April 2021 15:35:47 UTC