walky-talky

1.0.0 • Public • Published

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?

⭐️ this repo

License

MIT © Kamlesh Chandnani

Package Sidebar

Install

npm i walky-talky

Weekly Downloads

2

Version

1.0.0

License

ISC

Last publish

Collaborators

  • kamleshchandnani