You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me like waitUntil() can be significantly simplified if it uses Promise.all that is now in the ES spec.
While the event is dispatching (since waitUntil() can't be called when async), every promise passed to it is appended to an array. At the end of the dispatch wait on Promise.all(list of promises). That way we get 'rejection gets priority' for free.
The text was updated successfully, but these errors were encountered:
At the end of the dispatch wait on Promise.all(list of promises). That way we get 'rejection gets priority' for free.
The task that runs the waitUntil() is actually doing this: "waiting for all of extendLifetimePromises settles."
It's sort of double-defined once in waitUntil()'s task algorithm's step 3 and Install algorithm step 11.5 and Active algorithm step 15.5.
May be we can try to simplify this bit by reducing one side of such steps, but on one hand I think it seems easier to understand the relationship of those algorithms as-is.
And waiting for all of, the algorithm description for Promise.all, is already giving us 'rejection gets priority' semantic as you pointed.
It seems to me like waitUntil() can be significantly simplified if it uses Promise.all that is now in the ES spec.
While the event is dispatching (since waitUntil() can't be called when async), every promise passed to it is appended to an array. At the end of the dispatch wait on Promise.all(list of promises). That way we get 'rejection gets priority' for free.
The text was updated successfully, but these errors were encountered: