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

@hanguokai 

> `await` a resolved promise is Ok, although not common.

I think it's pretty common pattern, and it's one of the reasons promises don't expose their state. It's encouraged to "just await the promise", rather than `if (resolved) doThing else awaitThingThenDoThing`. Eg, the example here https://www.npmjs.com/package/idb#examples, where `dbPromise` will be already-settled for most of the calls.

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

Received on Wednesday, 7 April 2021 08:08:42 UTC