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

Provide ViewModelStoreOwner by Compose view #1291

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

MatkovIvan
Copy link
Member

Proposed Changes

  • Add lifecycle-viewmodel dependency to compose:ui
  • Implement ViewModelStoreOwner in compose view for Desktop, iOS and Web
  • Remove ViewModelStoreOwner workaround from NavHost
  • Use findComposeDefaultViewModelStoreOwner to find ViewModelStoreOwner from compose:ui

Testing

Test: Try to use ViewModel outside of NavHost without implementing own ViewModelStoreOwner

@MatkovIvan MatkovIvan merged commit fe3ca32 into jb-main Apr 19, 2024
6 checks passed
@MatkovIvan MatkovIvan deleted the ivan.matkov/compsoe-vm-owner branch April 19, 2024 15:02
MatkovIvan added a commit that referenced this pull request Apr 22, 2024
This PR reverts `NavHost` part of #1291

Let's keep this fallback for now to avoid errors like
JetBrains/compose-multiplatform#4657 (comment)
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

Successfully merging this pull request may close these issues.

3 participants