Skip to content

What about offline first, live local datastore updates #178

Open
@theGlenn

Description

@theGlenn

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 UseCaseobjects:

  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.
 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions