@hazae41/worker-online-polyfill
v1.0.0
Published
Polyfill for online and offline events on WebWorkers
Downloads
35
Maintainers
Readme
WebWorkers "online" and "offline" events polyfill
Polyfill for online
and offline
events on WebWorkers
https://issues.chromium.org/issues/40155587
npm i @hazae41/worker-online-polyfill
Node Package 📦 • Deno Module 🦖
Features
- ESModules and CommonJS
- No external dependency
Usage
How?
ESModules
import "@hazae41/worker-online-polyfill"
CommonJS
require("@hazae41/worker-online-polyfill")
Deno
import "https://deno.land/x/worker_online_polyfill/src/mod.ts"
Where?
You can import the polyfill in your worker entry file or in a specific file
import "@hazae41/worker-online-polyfill"
self.addEventListener("online", () => console.log("online"))
self.addEventListener("offline", () => console.log("offline"))