android10 / android10/Android-CleanArchitecture
What about offline first, live local datastore updates
- Dominant language
- Java
- Stars
- 15.5k
- Forks
- 3.3k
- PR merge metrics
- No merged PRs in 30d
Description
Hi all.
Alright in my project I followed an offline first architecture where I'm always Querying the local datastore. For each ressources that requires query, a `Presenter` has two `UseCase`objects:
1. One that makes requests to the remote data store and save it locally, it never deliver information to presenter, the `rx.Subscriber` only does Logging. All saving operations are performed in `doOnNext`.
2. Another one that is directly subscribed to the local dataStore and listen for insertion/deletion/updates via an Observable so that once something is changed it queries data and present it to the view.
``` Java
final FetchArticleCollectionUseCase mFetchArticleCollectionUseCase;
final GetArticleUpdatesUseCase mGetArticleUpdatesUseCase;
```
It's working pretty well now. But I'm wondering if I'm still making a good use of `UseCase`. And I personally find it cumbersome to write two `UseCase` for one data output every time.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.