@Test public void effectPerformerRunsActionOnSchedulerWheneverEffectIsRequested() throws Exception { PublishSubject<String> upstream = PublishSubject.create(); TestAction action = new TestAction(); TestScheduler scheduler = new TestScheduler(); upstream.compose(Transformers.fromAction(action, scheduler)).subscribe(); upstream.onNext("First Time"); assertThat(action.getRunCount(), is(0)); scheduler.triggerActions(); assertThat(action.getRunCount(), is(1)); }
static <F, E> ObservableTransformer<F, E> fromAction(@NonNull final Action doEffect) { return fromAction(doEffect, null); }
Transformers { static <F, E> ObservableTransformer<F, E> fromAction(@NonNull final Action doEffect) { return fromAction(doEffect, null); } }
Transformers { static <F, E> ObservableTransformer<F, E> fromAction(@NonNull final Action doEffect) { return fromAction(doEffect, null); } private  Transformers(); }
Transformers { static <F, E> ObservableTransformer<F, E> fromAction(@NonNull final Action doEffect) { return fromAction(doEffect, null); } private  Transformers();  }
Transformers { static <F, E> ObservableTransformer<F, E> fromAction(@NonNull final Action doEffect) { return fromAction(doEffect, null); } private  Transformers();   }