Skip to content

Why do configurations in the stack have to be unqiue? #51

Answered by arkivanov
gnawf asked this question in Q&A
Discussion options

You must be logged in to vote

Hello and thanks for the question. This is because how the API is designed, the main method for navigation is as follows: navigate(transformer: (List<C>) -> List<C>). So instead of direct commands like push or pop, there is one single method navigate.

One the one hand, this gives a lot of flexibility, as you can manipulate the stack how you want. For example you may want to navigate from A <- B <- C <- D to C <- E <- A (the head of the stack is at the end).

But on the other hand, the Router has a requirement to destroy removed components, to create new components, and to do nothing with the components that are still in the stack. In order to achieve it, the Router calculates diffs between…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by arkivanov
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Perfomer
Comment options

@moffpage
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #19 on March 18, 2022 16:15.