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

fullName in callback is inconsistent? #27

Open
c-dante opened this issue Dec 18, 2019 · 0 comments
Open

fullName in callback is inconsistent? #27

c-dante opened this issue Dec 18, 2019 · 0 comments

Comments

@c-dante
Copy link

c-dante commented Dec 18, 2019

Not sure what the intention is here:

const routeNode = new RouteNode(
route.name,
route.path,
route.children,
cb,
this,
false,
sort
)
const fullName = routeNode
.getParentSegments([routeNode])
.map(_ => _.name)
.join('.')
if (cb) {
cb({
...route,
name: fullName
})
}
this.addRouteNode(routeNode, sort)

But in the cb, the name field is overwritten by this fullName property.

This is the only time in the entire lifecycle of the RouteNode where the name is obscured and overwritten as such.

Is this intentional? It's breaking code in router5 (and probably other places?) that rely on the callback.

It seems extra bad that the node itself doesn't get this fullName property -- just the spread in this callback.

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

No branches or pull requests

1 participant