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

Binding news into view models #154

Open
altairmizuchi opened this issue Mar 2, 2022 · 1 comment
Open

Binding news into view models #154

altairmizuchi opened this issue Mar 2, 2022 · 1 comment

Comments

@altairmizuchi
Copy link

Hello, everyone!

I am trying to understand how to bind feature state and news into one ViewModel. Let's assume I have data class MyViewModel(val users: List<User>, val loadError: String?) and I have loading error as News class with error message text and I have users list as part of feature State
I do not understand how to wire them together. Should I do some magic combining feature with its own feature.news somehow. Or does it mean I am doing something wrong and News aren't supposed to affect ViewModels.
In other words, what are the best practicies here?

@arturh
Copy link

arturh commented Apr 1, 2022

Have you considered putting the loading error in the state?

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

No branches or pull requests

2 participants