Skip to content
/ pubbie Public

Pubbie is a basic Pub/Sub Library. Handles your basics such as subscribing, publishing, and unsubscribing events/tokens.

Notifications You must be signed in to change notification settings

BennyC/pubbie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pubbie

Pubbie is a basic Pub/Sub Library. Handles your basics such as subscribing, publishing, and unsubscribing events/tokens.

Usage

var counter = 0,
    func    = function (arg) {
        counter = arg || 1;
    };

pubbie.subscribe('message', func);

pubbie.publish('message'); // counter === 1;
pubbie.publish('message', [2]); // counter === 2

pubbie.unsubscribe('message');
pubbie.publish('message'); // counter === 2 | Will remain at 2 as the function no longer exists.

Functions

pubbie.subscribe(namespace, fn)

pubbie.publish(namespace[, args])

pubbie.unsubscribe(identifier)

Want to play with Pubbie?

NodeJS is required, once installed run npm install in the directory to get all dependancies. If you can't be bothered with the unit tests/building, just edit the source code found in the src/ folder.

Testing

Simply run grunt test

Building

Once you've made the changes you wish to make to the source code, simply run grunt to get a minified version in the build folder.

Contributing

Please feel free to open pull requests/issues regarding Pubbie.

About

Pubbie is a basic Pub/Sub Library. Handles your basics such as subscribing, publishing, and unsubscribing events/tokens.

Resources

Stars

Watchers

Forks

Packages

No packages published