Skip to content

Instantly share code, notes, and snippets.

@Raysharr
Created October 18, 2012 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raysharr/3914557 to your computer and use it in GitHub Desktop.
Save Raysharr/3914557 to your computer and use it in GitHub Desktop.
jquery.pubsub
(function ($) {
var o = $( {} );
$.each({
trigger: 'publish',
on: 'subscribe',
off: 'unsubscribe'
}, function (key, val) {
$[val] = function () {
o[key].apply(o, arguments);
};
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment