Skip to content

Instantly share code, notes, and snippets.

View raulh82vlc's full-sized avatar

Raul Hernandez raulh82vlc

View GitHub Profile
@raulh82vlc
raulh82vlc / Pager.java
Created May 31, 2016 18:00 — forked from mttkay/Pager.java
A simple Rx based pager
public class Pager<I, O> {
private static final Observable FINISH_SEQUENCE = Observable.never();
private PublishSubject<Observable<I>> pages;
private Observable<I> nextPage = finish();
private Subscription subscription = Subscriptions.empty();
private final PagingFunction<I> pagingFunction;
private final Func1<I, O> pageTransformer;