Tabsub 📻
A tiny (~500B) Pub/Sub library that simply works
Intro
Tabsub is a tiny library with minimal API that allows simple communication between browsing contexts with the same origin. It works with the BroadcastChannel API with a sensible fallback to localStorage, thus it works with all modern browsers.
Installation
Install Tabsub from the NPM registry as:
npm install --save tabsub
Usage
Create a channel and send a message
; const radio = ;radio;radio;
Create a channel start listening for incoming messages
; const radio = ;r;
Pause and restart a channel
; const radio = ;// Postingradio;radio; radio; radiostart;radio;
Browser support
All modern browsers using the BroadcastChannel API and the localStorage API