Skip to content
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

Merged
merged 6 commits into from
Oct 25, 2023
Merged

Router constructor config #67

merged 6 commits into from
Oct 25, 2023

Conversation

chrisgubbels
Copy link
Contributor

Adds optional routeConfig constructor prop to more easily create an applications routeTree.

Copy link
Member

@ChadKillingsworth ChadKillingsworth left a 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));
Copy link
Member

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

Copy link
Contributor

@barronhagerman barronhagerman left a 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 👍

Copy link
Contributor

@jivewise jivewise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@chrisgubbels chrisgubbels merged commit e1426e9 into master Oct 25, 2023
5 checks passed
@chrisgubbels chrisgubbels deleted the router-constructor-config branch October 25, 2023 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants