Skip to content

Commit

Permalink
Support passing type to Actions.route, fixes #155
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienbrault committed Jan 28, 2016
1 parent 2594f96 commit e478c25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ export default class Router {
if (!this.routes[name]){
throw new Error("No route is defined for name="+name);
}
const action = this.routes[name].type === "switch" ? "jump": this.routes[name].type;
const type = props.type ? props.type : this.routes[name].type;
const action = type === "switch" ? "jump": type;
if (!action){
throw new Error("No type is defined for name="+name);
}
Expand Down

0 comments on commit e478c25

Please sign in to comment.