share viewmodel between jetpack compose components #1193
Unanswered
pablocaviglia-uy
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'd like to know how can I get always the same instance of a viewModel defined in a module from different components.
Right now I dont really understand how it works, I've tried with getStateViewModel(), getViewModel(), but I get different instances of the viewmodel class. I've tried by defining the viewmodel as 'single' on the module, but I know that isn't the correct solution.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions