https://github.com/hasangenc0/pubsub
PubSub in 20 lines with Broadcast Channels. (It can be done using MessageChannel for better compatibility.)
https://github.com/hasangenc0/pubsub
broadcastchannel messagechannel pubsub web
Last synced: 9 months ago
JSON representation
PubSub in 20 lines with Broadcast Channels. (It can be done using MessageChannel for better compatibility.)
- Host: GitHub
- URL: https://github.com/hasangenc0/pubsub
- Owner: hasangenc0
- Created: 2021-02-04T20:51:47.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-04T20:52:57.000Z (over 5 years ago)
- Last Synced: 2025-07-24T03:47:06.493Z (11 months ago)
- Topics: broadcastchannel, messagechannel, pubsub, web
- Language: JavaScript
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pubsub
PubSub in 20 lines with Broadcast Channels
```
window.pubsub = new pubsub();
window.pubsub.subscribe("showAlert", (data) => {
alert(data.message);
});
window.pubsub.publish("showAlert", { message: "wazzup" });
```