playmoweb / store2realm

Synchronize Realm with another Store. Realm Implementation for store2store library
MIT License
11 stars 6 forks source link

Update example to use store2realm as a cache #8

Closed tspoke closed 6 years ago

tspoke commented 6 years ago

To use Store2Realm as a cache you can have a look to the example in the project. You just have to pass a second argument (true) to the onObserve method :

postService.getAll(filter, sortingMode)
    .subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread(), true) // add true here if you want to delay the error and receive the realm update first
    ...

Fix #7