Skip to content

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

Closed
@jasorod

Description

@jasorod

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions