Web APIs

ExtendableEvent.prototype.waitUntil()

Try the free JavaScript compiler

Extends the lifetime of an extendable service worker event until the associated promise settles.

Formal Syntax & Structure

javascript syntaxjavascript
event.waitUntil(promise)

Parameters & Attributes

NameTypeDescription
promisePromiseAsynchronous 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")));});})()
JavaScript Reference