@Test public void onNextCallsCallbacks() { TestSubject<String> subject = TestSubject.create(scheduler); Loader.Callbacks<Result<String>> callbacks = mock(Loader.Callbacks.class); RxLoader<String> loader = new RxLoader<>(subject); loader.setCallbacks(callbacks); loader.start(); subject.onNext("test"); scheduler.triggerActions(); verify(callbacks).onLoaderStart(); verify(callbacks).onLoaderResult(Result.success("test")); }
public static <T> RetainState.OnCreate<RxLoader<T>> create(final Observable<T> observable) { return new RetainState.OnCreate<RxLoader<T>>() { @Override public RxLoader<T> onCreate() { return new RxLoader<>(observable); } }; }
RxLoader extends Loader<Result<T>> { public static <T> RetainState.OnCreate<RxLoader<T>> create(final Observable<T> observable) { return new RetainState.OnCreate<RxLoader<T>>() { @Override public RxLoader<T> onCreate() { return new RxLoader<>(observable); } }; } }
RxLoader extends Loader<Result<T>> { public static <T> RetainState.OnCreate<RxLoader<T>> create(final Observable<T> observable) { return new RetainState.OnCreate<RxLoader<T>>() { @Override public RxLoader<T> onCreate() { return new RxLoader<>(observable); } }; } RxLoader(rx.Observable<T> observable); }
RxLoader extends Loader<Result<T>> { public static <T> RetainState.OnCreate<RxLoader<T>> create(final Observable<T> observable) { return new RetainState.OnCreate<RxLoader<T>>() { @Override public RxLoader<T> onCreate() { return new RxLoader<>(observable); } }; } RxLoader(rx.Observable<T> observable); static RetainState.OnCreate<RxLoader<T>> create(final Observable<T> observable); }
RxLoader extends Loader<Result<T>> { public static <T> RetainState.OnCreate<RxLoader<T>> create(final Observable<T> observable) { return new RetainState.OnCreate<RxLoader<T>>() { @Override public RxLoader<T> onCreate() { return new RxLoader<>(observable); } }; } RxLoader(rx.Observable<T> observable); static RetainState.OnCreate<RxLoader<T>> create(final Observable<T> observable);  }