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

[New architecture] Improve viewmodel behaviour #2565

Closed
3 tasks done
davigonz opened this issue Jun 3, 2019 · 0 comments
Closed
3 tasks done

[New architecture] Improve viewmodel behaviour #2565

davigonz opened this issue Jun 3, 2019 · 0 comments

Comments

@davigonz
Copy link
Contributor

davigonz commented Jun 3, 2019

There's some scenarios in which we are sharing the livedata between different operations (getShares, createShares, removeShares()) , triggering some sort of duplicated calls when there's a successful operation for example. The app works fine so far but I think this approach may be improved.

The basic implementation of a viewmodel is based on a livedata that is explicitly used to get the data, not to edit or even delete it, since for those cases the changes should be automatically propagated to that livedata.

Why are we using livedata for more cases apart from getting shares? Because we need to propagate network errors to UI for instance and that's not a basic case.

It would be great to work on splitting up the class responsible for warning the active observers into different ones so that creation and edition/deletion/other operations can be easily distinguishable and do not interfere between them.

PR

App: #2569

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants