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

currentNavigable #255

Merged
merged 1 commit into from
Aug 9, 2022
Merged

currentNavigable #255

merged 1 commit into from
Aug 9, 2022

Conversation

Kritarie
Copy link
Contributor

@Kritarie Kritarie commented Aug 4, 2022

Removes global CurrentNavigableProvider for recursive, scoped currentNavigable.

#254

@Kritarie Kritarie requested a review from cmathew August 4, 2022 20:04
@@ -3,4 +3,6 @@ package com.wealthfront.magellan.navigation
import com.wealthfront.magellan.core.Displayable
import com.wealthfront.magellan.lifecycle.LifecycleAware

public interface NavigableCompat : LifecycleAware, Displayable
public interface NavigableCompat : LifecycleAware, Displayable {
public val currentNavigable: NavigableCompat get() = this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm why is this method on Navigable instead of Navigator? Please don't tell me it's because of LazySetNavigator 😩

Copy link
Contributor

@cmathew cmathew Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see - it lets us avoid reflection when sifting thru backstacks. We can just treat all Navigables equally i.e. without filtering for Navigators only

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, and this also allows the application developer to define current screen when it's otherwise undefined. Example: a Step containing two "sibling" Journeys doesn't have a well-defined "current" screen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. I could imagine a master-detail arrangement, where an application developer would have a better sense of what the "current" navigable is

@Kritarie Kritarie merged commit faf0d74 into master Aug 9, 2022
@Kritarie Kritarie deleted the current-navigable branch August 9, 2022 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants