Created — forked from cowboy/HEY-YOU.md

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.

View jquery.ba-tinypubsub.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
 
(function($) {
 
var o = $({});
 
$.subscribe = function() {
o.on.apply(o, arguments);
};
 
$.unsubscribe = function() {
o.off.apply(o, arguments);
};
 
$.publish = function() {
o.trigger.apply(o, arguments);
};
 
}(jQuery));
View jquery.ba-tinypubsub.js
1 2 3 4
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function(a){var b=a({});a.subscribe=function(){b.on.apply(b,arguments)},a.unsubscribe=function(){b.off.apply(b,arguments)},a.publish=function(){b.trigger.apply(b,arguments)}})(jQuery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.