Interface: RegisterSWOptions
Properties
createWorkbox?
optionalcreateWorkbox:CreateWorkboxFn
workbox-window is lazy loaded by default if you're, for example, already lazy loading the virtual module you might want to minimize the number of generated chunks by importing workbox-window synchronously
immediate?
optionalimmediate:boolean
Setting this to true will register the SW immediately, even if the window has not loaded.
onNewSwActive()?
optionalonNewSwActive: () =>void
The new SW is controlling the page. You might want to refresh the page.
Returns
void
onNewSwWaiting()?
optionalonNewSwWaiting: () =>void
The new SW is waiting for activation. You may prompt the user and send "SKIP_WAITING" message to the SW.
Returns
void
onOfflineReady()?
optionalonOfflineReady: () =>void
The SW is installed.
Returns
void
onRegister()?
optionalonRegister: (event) =>void
The SW is registered.
Parameters
event
registration
ServiceWorkerRegistration | undefined
swUrl
string
Returns
void
onRegisterError()?
optionalonRegisterError: (error) =>void
Something went wrong during the SW registration.
Parameters
error
any
Returns
void