Web APIs
ExtendableEvent.prototype.waitUntil()
Extends the lifetime of an extendable service worker event until the associated promise settles.
Formal Syntax & Structure
javascript syntaxjavascript
event.waitUntil(promise)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| promise | Promise | Asynchronous work associated with the event. |
Return Value
undefined
Extends the lifetime of an extendable service worker event until the associated promise settles.
Working Example
Example Snippetjavascript
(async () => {self.addEventListener("activate",event=>{event.waitUntil(Promise.resolve().then(()=>console.log("activated")));});})()