Skip to content

Instantly share code, notes, and snippets.

@lennym
Created October 19, 2012 09:51
Show Gist options
  • Save lennym/3917226 to your computer and use it in GitHub Desktop.
Save lennym/3917226 to your computer and use it in GitHub Desktop.
route: function (route) {
if (typeof this[route] === 'function') {
// pass on any remaining arguments to route method
var args = [].slice.call(arguments, 1);
this[route].apply(this, args);
} else {
// some kind of error handling
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment