-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Router constructor config #67
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This concept looks sound to me.
router.js
Outdated
@@ -68,6 +79,17 @@ class Router { | |||
return this.prevNodeId_; | |||
} | |||
|
|||
/** @param {!RouteConfig} routeConfig */ | |||
buildRouteTree(routeConfig) { | |||
const node = new RouteTreeNode(new RouteData(routeConfig.id, routeConfig.tagName, routeConfig.path, routeConfig.parameters || [], !routeConfig.unAuth)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of unAuth
, consider using authenticated
with a default of true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think requiresAuthentication
would be a bit more clear than authenticated
, but otherwise 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
Adds optional routeConfig constructor prop to more easily create an applications routeTree.