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

[Navigation] Return early from NavigatorProvider#addNavigator if possible #176

Conversation

jossiwolf
Copy link
Contributor

We want to return early from addNavigator if the previous and to-be-added navigator are equal. This allows calling addNavigator as a side effect of every composition without having to worry about the Navigator being replaced every time.

Test: Added addExistingNavigatorDoesntReplace and addWithSameNameButUnequalNavigatorDoesReplace in NavigatorProviderTest.kt

Fixes: b/187443146
Change-Id: Id09b7e3306c49f261b80c724d36c614671f5a7ac

…tor are equal

We want to return early from `addNavigator` if the previous and to-be-added navigator are equal. This allows calling `addNavigator` as a side effect of every composition without having to worry about the Navigator being replaced every time.

Test: Added addExistingNavigatorDoesntReplace and addWithSameNameButUnequalNavigatorDoesReplace in NavigatorProviderTest.kt

Fixes: b/187443146
Change-Id: Id09b7e3306c49f261b80c724d36c614671f5a7ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants