diff --git a/astro.config.mjs b/astro.config.mjs index 45907ac..0e0bc91 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -28,7 +28,6 @@ export default defineConfig({ waiting: () => console.log('>>> waiting...'), active: () => console.log('>>> active...'), error: (error) => console.error('>>> error', error), - unsupported: () => console.log('>>> service worker unsupported'), afterRegistration: async () => { const sw = await navigator.serviceWorker.getRegistration(); console.log('>>> registrered', sw) diff --git a/index.js b/index.js index 8c63dd1..598828e 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,4 @@ +// @ts-check /** * @license MIT * @author Ayo Ayco @@ -50,12 +51,12 @@ export default function serviceWorker(options) { } = options || {}; const { - installing: installingFn, - waiting: waitingFn, - active: activeFn, - error: errorFn, - unsupported: unsupportedFn, - afterRegistration: afterRegistrationFn, + installing: installingFn = () => {}, + waiting: waitingFn = () => {}, + active: activeFn = () => {}, + error: errorFn = () => {}, + unsupported: unsupportedFn = () => {}, + afterRegistration: afterRegistrationFn = () => {}, } = registrationHooks; /**