1.0.0 • Published 6 years ago
walky-talky v1.0.0
walky-talky
EventListeners can easily go out of hand if not used with utmost care, walky-talky is a tiny JS library to create a message channel using Publish/Subscribe pattern.
Installation
yarn add walky-talky
or
npm install walky-talky --save
Usage
// module.js
import WalkyTalky from "walky-talky";
actionHandler = dataObject => {
// some logic
};
// subscribe to a custom action type
WalkyTalky.subscribe("ACTION_TYPE", actionHandler);
// app.js
import WalkyTalky from "walky-talky";
// publish the action type with the data object
WalkyTalky.publish("ACTION_TYPE", dataObject);
Like it?
:star: this repo
License
MIT © Kamlesh Chandnani
1.0.0
6 years ago