Skip to content

Instantly share code, notes, and snippets.

@blocka
Created November 13, 2013 16:50
Show Gist options
  • Save blocka/7452341 to your computer and use it in GitHub Desktop.
Save blocka/7452341 to your computer and use it in GitHub Desktop.
var i = 0;
var router = new (Backbone.Router.extend({
before: {
'someotherroute': function() {
},
'': function(fragment,args,next) {
setTimeout(function() {
alert('Called me ' + i++ + ' times');
next();
},1000)
}
}
}))();
router.route('',function() {
})
Backbone.history.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment