- From: Alfred Morgan <notifications@github.com>
- Date: Fri, 01 Dec 2017 22:29:32 +0000 (UTC)
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 1 December 2017 22:29:56 UTC
I would like the focus this issue to concentrate on keeping procedural programming intact. Javascript has been doing great at keeping multiple design patterns co-existing with each other. Using `await` keeps a straight forward line of execution. Using inline function nesting callbacks, I believe, will be universally frowned upon by 10 years. For good reasons unknown to me the `waitUntil()` broke the basic promise development pattern which in turn upset the await procedural style as I pointed out. I found that the missing link is the lack of the promise while inside an async function. Here is another example of a procedural style workaround: ```javascript self.addEventListener('install', event => { event.waitUntil(installHandler(event)); }); async function installHandler(event) { let cache = await caches.open(cacheName); await cache.addAll(cacheUrls); } ``` -- 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/1237#issuecomment-348631373
Received on Friday, 1 December 2017 22:29:56 UTC