Skip to content

Instantly share code, notes, and snippets.

@bendytree
Forked from rwaldron/jquery.ba-tinypubsub.js
Last active December 19, 2015 15:58
Show Gist options
  • Select an option

  • Save bendytree/5979756 to your computer and use it in GitHub Desktop.

Select an option

Save bendytree/5979756 to your computer and use it in GitHub Desktop.
jQuery Tiny Pub/Sub (Ridiculous)
/*!
* jQuery Tiny Pub/Sub - v0.X - 11/18/2010
* http://benalman.com/
*
* Original Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*
* Made awesome by Rick Waldron
*
* Made ridiculous by Josh Wright <@BendyTree>
* - minifies to 134 characters
*
*/
(function($, o){
o = $({});
$.each({
sub : "on",
unsub : "off",
pub : "trigger"
}, function ( fn, api ) {
$[fn] = function() {
o[api].apply(o, arguments);
};
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment