Skip to content

frankiebee/csw-readyevent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Client Side Service Worker Ready Event

Intended to be used with sw-stream to register a service worker and provide the active service worker on a ready event

Usage

const SWcontroller = require('client-sw-ready-event/lib/sw-client.js')
const SwStream = require('sw-stream/lib/sw-stream.js')

const background = new SWcontroller({
  fileName: '/service-worker.js',
  // optional
  scope: '/',
})

background.on('ready', () => {
  let swStream = SwStream({
    serviceWorker: background.controller,
  })
 // do stuff
})

background.startWorker()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published