Search in sources :

Example 1 with RedditData

use of com.nytimes.android.sample.data.model.RedditData in project Store by NYTimes.

the class StoreActivity method loadPosts.

@SuppressWarnings("CheckReturnValue")
public void loadPosts() {
    BarCode awwRequest = new BarCode(RedditData.class.getSimpleName(), "aww");
    this.nonPersistedStore.get(awwRequest).flatMapObservable(new Function<RedditData, ObservableSource<Post>>() {

        @Override
        public ObservableSource<Post> apply(@NonNull RedditData redditData) throws Exception {
            return sanitizeData(redditData);
        }
    }).toList().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::showPosts, throwable -> {
        Log.e(StoreActivity.class.getSimpleName(), throwable.getMessage(), throwable);
    });
}
Also used : RedditData(com.nytimes.android.sample.data.model.RedditData) ObservableSource(io.reactivex.ObservableSource) BarCode(com.nytimes.android.external.store3.base.impl.BarCode)

Aggregations

BarCode (com.nytimes.android.external.store3.base.impl.BarCode)1 RedditData (com.nytimes.android.sample.data.model.RedditData)1 ObservableSource (io.reactivex.ObservableSource)1