local-pub-sub
v0.0.1
Published
A pubsub library that works on top of localStorage.
Readme
Local PubSub
local-pub-sub.js is a pubsub library that is built on top of localStorage.
Demo
Development
Overview of Folder Structure
srccontains the pre-build files of local-pub-sub.js.gulpcontains the gulp task files.
Anatomy of Local PubSub
Here is the overview for the files under src folder:
index.jsis the entry point of local-pub-sub.js.pub-sub.jsis a simple same window pubsub implementation.
Set up The Local Environment
Here are the steps:
- Install
gulpglobally if you haven't done so. - Run
npm install. - Run
gulpto build thelocal-pub-sub.js.
Usage
localPubSub.subscribe('some-key', function (info) {
console.log(info);
});
localPubSub.publish('some-key, {price: 23});