-
Notifications
You must be signed in to change notification settings - Fork 41
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
Added Fluent Navigation #102
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Want to use getLink from fluent navigator so mustn't have 'this' reference
Means that Fluent and State navigators can call in same way
Current data passed as parameter so that navigation data can be created from current. Like includeCurrentData in NavigationLink. Don't need it in StateNavigator because can manually construct data from current data
Want it to be like reactive programming where each operator sets up a new subscription, it doesn't change the current subscription. That way multiple operators can apply to single subscription without worry. Instead of manipulating internal state of fluent navigator, create a fluent navigator each time with the new context. (new'ing objects is expensive, so went with functional approach)
Tried adding fluent tests inside existing navigation tests, like 'Navigate Link', but the asserts don't match because oldState isn't populated in fluent navigation. Fixing up Navigation tests so there's only one 'it' with multiple asserts instead of multiple 'its' with one assert.
NavigationDataManager was missing return type which stopped the d.ts generation
Strings starting with * showed up in url as /*, which editor mistook for a comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solves the problem of constructing links with pre-populated crumb trails. For example, how do you build a link to 'person' with the 'people' crumb populated so that back navigation works?
If the user navigates from 'people' to 'person' then the crumb is populated. Fluent navigation solves the problem of manually constructing this same link. Can't just call
getNavigationLink('person', {id: 10})
because that only works if the currentstate
is 'person'. Don't want to have to navigate to 'person'state
first because that changes the UI.Fluent navigation allows navigation without changing the current
state
or UI. Can then access the url from the fluent context.Especially useful for Navigation React Native (not released yet) where need to pre-populate the crumb trail stack when coming to the app from a notification, for example.