You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more of a usability enhancement vs. new feature but what do you think about breaking up the setRoute function into separate methods? I dislike how 'overloaded' it is. Depending on the params you pass in, the function will perform slightly different actions, making it hard to reason about and use.
RIght now, setRoute can be used in 4 different ways:
setRoute(route)
navigate to new route
setRoute(start, length)
remove a segment from the current route
setRoute(index, value)
replace a segment of the current route
setRoute(start, length, value)
remove and set a segment on the current route
Caveat is that this will introduce breaking changes to the router (I guess we could make it backwards compatible but not a huge fan of that idea)
Also, I'm willing to submit a PR for this if you think it's a good idea
Thoughts?
The text was updated successfully, but these errors were encountered:
Sounds like a good idea, and looks much more readable to me. Why don't you do a PR, with updated tests, so others can do functional reviews? Thanks @albertalquisola!!!!
This is more of a usability enhancement vs. new feature but what do you think about breaking up the
setRoute
function into separate methods? I dislike how 'overloaded' it is. Depending on the params you pass in, the function will perform slightly different actions, making it hard to reason about and use.RIght now, setRoute can be used in 4 different ways:
setRoute(route)
setRoute(start, length)
setRoute(index, value)
setRoute(start, length, value)
Caveat is that this will introduce breaking changes to the router (I guess we could make it backwards compatible but not a huge fan of that idea)
Also, I'm willing to submit a PR for this if you think it's a good idea
Thoughts?
The text was updated successfully, but these errors were encountered: