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

Philosphy behind choosing whether to pop or change a segment #88

Closed
jasorod opened this issue Dec 6, 2017 · 1 comment
Closed

Philosphy behind choosing whether to pop or change a segment #88

jasorod opened this issue Dec 6, 2017 · 1 comment

Comments

@jasorod
Copy link

jasorod commented Dec 6, 2017

Let's say I have two different routes that are different lengths that descend from the same parent node:

[ "foo", "bar1", "baz" ]
[ "foo", "bar2" ]

And I have four different Routable objects:

  1. foo
  2. bar1
  3. bar2
  4. baz

where "foo" is the parent Routable of "bar1" and "bar2", and "baz" is a child routable of "bar1".

When I make the transition between the two routes, it would make sense to me that "bar1" would be sent a pop-action to remove "baz", but why should "foo" also be sent a pop-action to remove "bar1" and then be sent a separate push-action to add back "bar2"? Since they share the same common parent in "foo", shouldn't "foo" get sent a change-action to exchange "bar1" with "bar2"?

Right now the behavior defining this is from the following rule:

  1. The old route had an element after the commonSubroute and the new route does not we need to pop the route segment after the commonSubroute

And it means that everything descending from "foo", because the routes are different lengths, is first popped off and then pushed back on, rather than popping off the non-common elements but doing a change-action for the most senior child element that is not in the common subroute.

Is this default behavior something that should possibly be modified?

@kmmraj
Copy link
Contributor

kmmraj commented Jul 11, 2019

I think it is a bug, the change action should be called when the routes are
old --> [ "foo", "bar1", "baz" ]
new --> [ "foo", "bar2" ]
the transistion between bar1 to bar2

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

2 participants