@snelusha/cereal
v1.0.1
Published
Simple PubSub library for Javascript
Downloads
3
Maintainers
Readme
Getting Started
Installation
npm install @snelusha/cereal
Usage
// Subscribe
import { subscribe } from "@snelusha/cereal";
subscribe("SUBSCRIBE_TOPIC", (payload) => console.log(payload));
// Publish
import { publish } from "@snelusha/cereal";
publish("SUBSCRIBE_TOPIC", payload);
// Unsubscribe
import { subscribe } from "@snelusha/cereal";
const unsubscribe = subscribe("SUBSCRIBE_TOPIC", (payload) =>
console.log(payload)
);
unsubscribe();