Skip to content

Instantly share code, notes, and snippets.

@jcreamer898
Last active December 11, 2015 07:18
Show Gist options
  • Save jcreamer898/4565000 to your computer and use it in GitHub Desktop.
Save jcreamer898/4565000 to your computer and use it in GitHub Desktop.
Abstract backbone's trigger method and call Monologue's emit.
// Push backbone's routing events to the buss.
var trigger = AppRouter.prototype.trigger;
AppRouter.prototype.trigger = function() {
var args = Array.prototype.slice.call( arguments, 1 );
this.emit( arguments[ 0 ], args );
trigger.apply( this, args );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment