Skip to content

Instantly share code, notes, and snippets.

@Raysharr
Created October 18, 2012 20:39
Show Gist options
  • Select an option

  • Save Raysharr/3914557 to your computer and use it in GitHub Desktop.

Select an option

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