1×
Become a member
to unlock all features
Autoplay

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

    reactReact
    16.6.3-16.8.6

    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.