Skip to content

Instantly share code, notes, and snippets.

@adampatterson
Created December 17, 2014 19:23
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 adampatterson/3c901aa4cbba8d62b3aa to your computer and use it in GitHub Desktop.
Save adampatterson/3c901aa4cbba8d62b3aa to your computer and use it in GitHub Desktop.
Uatu
(function($) {
var o = $( {} );
$.each({
trigger: 'publish',
on: 'subscribe',
off: 'unsubscribe'
}, function( key, val ) {
jQuery[val] = function() {
o[key].apply( o, arguments );
};
});
})( jQuery );
$.publish('calculator.click', event)
$.subscribe( 'calculator.click', function(e){
console.log('event click');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment