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

That is more concise, but doesn't seem that much better than:

```javascript
var cache;
var init_promise = async function() {
  cache = await readDataFromStorage();
}();

self.addEventListener('fetch', evt =>{
  evt.respondWith(async function() {
    await init_promise;
    // use cache data
  }());
});
```

-- 
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-814221416

Received on Tuesday, 6 April 2021 15:40:08 UTC