VictorAlbertos / ReactiveCache

A reactive cache for Android and Java which honors the reactive chain.
Apache License 2.0
240 stars 24 forks source link

Q: read item with key #18

Closed jemshit closed 6 years ago

jemshit commented 7 years ago

How to read Event item lets say, with key ? In readme, i can only see cacheProvider.read() which does not take key. As i understand, there are two keys? in this library, one for cacheProvider like "event", another for item itself like "1243". Is that correct

VictorAlbertos commented 6 years ago

You can use ProviderGroup for that.

ProviderGroup<List<Model>> cacheProvider =
        reactiveCache.<List<Model>>providerGroup()
        .withKey("modelsPaginated")

api.getModels(group)
    .compose(cacheProvider.replace(group))