vite-pwa/vite-plugin-pwa

preact + ts and types issue

userquin opened this issue · 0 comments

Using Preact + TS:

const {
    offlineReady: [offlineReady, setOfflineReady],
    needRefresh: [needRefresh, setNeedRefresh],
    updateServiceWorker,
  } = useRegisterSW({..})

function close() {
    typeof setOfflineReady === 'function' && setOfflineReady(false)
    typeof setNeedRefresh === 'function' && setNeedRefresh(false)
  }

without the typeof check:

imagen