1. 6
    Listen for `install` and `activate` PWA Events in a Service Worker
    2m 1s

Listen for `install` and `activate` PWA Events in a Service Worker

InstructorChris Achard

Share this video with your friends

Send Tweet

Service workers are event-based, so we'll listen for the install and activate events, which will let us execute code when our PWA gets installed for the first time. We'll use setTimeout to simulate an asynchronous action and wait for that to complete, before allowing the PWA to continue installing.