- From: Jake Archibald <notifications@github.com>
- Date: Wed, 07 Apr 2021 01:08:30 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 7 April 2021 08:08:42 UTC
@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