Skip to content

Instantly share code, notes, and snippets.

@fadonascimento
Last active January 4, 2016 03:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save fadonascimento/0dbf82f5a81d77ef6b83 to your computer and use it in GitHub Desktop.
Pub/Sub Jquery
(function($) {
var o = $({});
$.subscribe2 = function() {
o.on.apply(o, arguments);
};
$.unsubscribe2 = function() {
o.off.apply(o, arguments);
};
$.publish2 = function() {
o.trigger.apply(o, arguments);
};
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment