Skip to content

Instantly share code, notes, and snippets.

@taras
Created October 3, 2013 16:35
Show Gist options
  • Select an option

  • Save taras/6812841 to your computer and use it in GitHub Desktop.

Select an option

Save taras/6812841 to your computer and use it in GitHub Desktop.
What if we removed special meaning from **redirect** hook and added a new syntax that would allow hooks to be triggers 'before' or 'after' another hook? We would add a deprecation notice to **redirect** that would state that **redirect** has no special meaning.
App.IndexRoute = Ember.Application.extend({
redirect: function(transition) {
this.transitionTo('movies');
}.before('model') // execute before model hook
});
App.IndexRoute = Ember.Application.extend({
redirect: function(model, transition) {
this.transitionTo('movies', model);
}.after('model') // execute after model hook
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment