Skip to content

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

Closed
jossiwolf wants to merge 1 commit into
androidx:androidx-mainfrom
jossiwolf:check-existing-navigators-when-adding-navigator
Closed

[Navigation] Return early from NavigatorProvider#addNavigator if possible#176
jossiwolf wants to merge 1 commit into
androidx:androidx-mainfrom
jossiwolf:check-existing-navigators-when-adding-navigator

Conversation

@jossiwolf

Copy link
Copy Markdown
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
@copybara-service copybara-service Bot closed this in 1f9f72f May 8, 2021
@jossiwolf
jossiwolf deleted the check-existing-navigators-when-adding-navigator branch May 8, 2021 09:48
harryzz pushed a commit to harryzz/compose-multiplatform-core that referenced this pull request Jul 28, 2026
… possible

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

This is an imported pull request from androidx#176.

Resolves JetBrains#176
Github-Pr-Head-Sha: ba934c5
GitOrigin-RevId: 471dbf4
Change-Id: I5aefe997aaaf41f5080895c9c8cfcd6c83282eea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants