Skip to content

A simple javascript pub-sub model, with arguments in the style of jQuery events.

Notifications You must be signed in to change notification settings

alegscogs/pubsub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

PubSub

A simple javascript pub-sub model, with arbitrary arguments in the style of javascript function arguments and jQuery events.

http://github.com/alegscogs/pubsub

Based on Peter Higgins (http://github.com/phiggins42/bloody-jquery-plugins) implementation, with changes to the style of arguments.

Usage

If you find yourself binding and triggering the same event interaction on the document node, you can probably save yourself some overhead by skipping the DOM and using pub-sub.

    $.subscribe('status', function(thing, state){
      console.log(thing, state);
    });

    var object = { name : null };

    $.publish('validation', object, 'invalid');

License

Copyright Alex Cox, but anyone can do whatever they want with this without worrying about me.

About

A simple javascript pub-sub model, with arguments in the style of jQuery events.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published