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

Core plugin: navigation #56

Open
5 of 6 tasks
rigor789 opened this issue May 3, 2020 · 0 comments
Open
5 of 6 tasks

Core plugin: navigation #56

rigor789 opened this issue May 3, 2020 · 0 comments
Assignees

Comments

@rigor789
Copy link
Owner

rigor789 commented May 3, 2020

Implement the navigation plugin:

  • $navigateTo(target: Component, options: NavigateToOptions)
  • $navigateBack

Ideas:

  • Add a key to NavigateToOptions and allow passing that same key to $navigateBack to navigate back to a specific page in the backstack - identified by that key. Use case: User can navigate to different pages and back, and on any of these pages, a button can navigate back to the n-th page without clearing history.

Things to keep in mind:

  • $navigateTo needs to attach event listeners to the Page - to clean up after the page is no longer needed
  • $navigateTo should accept a frame id - and resolve it to a Frame instance. getFrameById will only resolve frames that have already navigated - so we need to maintain a map of ids and frames, so we can resolve them.
  • $navigateTo - re-think the resolveOnEvent option from 2.x - I think it makes more sense to do that in userland?
  • $navigateTo - (TBD) BREAKING CHANGE (compared to 2.x): default frame will be topmost instead of default. Pros: less verbose to navigate last frame Cons: can be "random" and navigate the wrong frame in some circumstances.
@rigor789 rigor789 self-assigned this May 3, 2020
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