@Test public void testViewModelSendsEffectsIntoLoop() { fakeLifecycle.handleLifecycleEvent(Lifecycle.Event.ON_RESUME); underTest.dispatchEvent(new TestEvent("testable")); assertThat(recordedEvents.size(), equalTo(1)); assertThat(recordedEvents.get(0).name, equalTo("testable")); }
public final void dispatchEvent(@Nonnull E event) { if (loopActive.get()) { loop.dispatchEvent(event); } }
MobiusLoopViewModel extends ViewModel { public final void dispatchEvent(@Nonnull E event) { if (loopActive.get()) { loop.dispatchEvent(event); } } }
MobiusLoopViewModel extends ViewModel { public final void dispatchEvent(@Nonnull E event) { if (loopActive.get()) { loop.dispatchEvent(event); } } protected  MobiusLoopViewModel(
      @Nonnull Function<Consumer<V>, MobiusLoop.Factory<M, E, F>> loopFactoryProvider,
      @Nonnull M modelToStartFrom,
      @Nonnull Init<M, F> init,
      @Nonnull WorkRunner mainLoopWorkRunner,
      int maxEffectQueueSize); }
MobiusLoopViewModel extends ViewModel { public final void dispatchEvent(@Nonnull E event) { if (loopActive.get()) { loop.dispatchEvent(event); } } protected  MobiusLoopViewModel(
      @Nonnull Function<Consumer<V>, MobiusLoop.Factory<M, E, F>> loopFactoryProvider,
      @Nonnull M modelToStartFrom,
      @Nonnull Init<M, F> init,
      @Nonnull WorkRunner mainLoopWorkRunner,
      int maxEffectQueueSize); static MobiusLoopViewModel<M, E, F, V> create(
      @Nonnull Function<Consumer<V>, MobiusLoop.Factory<M, E, F>> loopFactoryProvider,
      @Nonnull M modelToStartFrom,
      @Nonnull Init<M, F> init); static MobiusLoopViewModel<M, E, F, V> create(
      @Nonnull Function<Consumer<V>, MobiusLoop.Factory<M, E, F>> loopFactoryProvider,
      @Nonnull M modelToStartFrom,
      @Nonnull Init<M, F> init,
      int maxEffectsToQueue); @Nonnull final M getModel(); @Nonnull final LiveData<M> getModels(); @Nonnull final LiveQueue<V> getViewEffects(); final void dispatchEvent(@Nonnull E event); }
MobiusLoopViewModel extends ViewModel { public final void dispatchEvent(@Nonnull E event) { if (loopActive.get()) { loop.dispatchEvent(event); } } protected  MobiusLoopViewModel(
      @Nonnull Function<Consumer<V>, MobiusLoop.Factory<M, E, F>> loopFactoryProvider,
      @Nonnull M modelToStartFrom,
      @Nonnull Init<M, F> init,
      @Nonnull WorkRunner mainLoopWorkRunner,
      int maxEffectQueueSize); static MobiusLoopViewModel<M, E, F, V> create(
      @Nonnull Function<Consumer<V>, MobiusLoop.Factory<M, E, F>> loopFactoryProvider,
      @Nonnull M modelToStartFrom,
      @Nonnull Init<M, F> init); static MobiusLoopViewModel<M, E, F, V> create(
      @Nonnull Function<Consumer<V>, MobiusLoop.Factory<M, E, F>> loopFactoryProvider,
      @Nonnull M modelToStartFrom,
      @Nonnull Init<M, F> init,
      int maxEffectsToQueue); @Nonnull final M getModel(); @Nonnull final LiveData<M> getModels(); @Nonnull final LiveQueue<V> getViewEffects(); final void dispatchEvent(@Nonnull E event);  }