@Test public void testViewModelgetModelAtStartIsInitialModel() { fakeLifecycle.handleLifecycleEvent(Lifecycle.Event.ON_RESUME); assertThat(underTest.getModel().name, equalTo("initial model")); recordingModelObserver.assertValues(initialModel); }
@Nonnull public final M getModel() { M model = loop.getMostRecentModel(); return model != null ? model : startModel; }
MobiusLoopViewModel extends ViewModel { @Nonnull public final M getModel() { M model = loop.getMostRecentModel(); return model != null ? model : startModel; } }
MobiusLoopViewModel extends ViewModel { @Nonnull public final M getModel() { M model = loop.getMostRecentModel(); return model != null ? model : startModel; } 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 { @Nonnull public final M getModel() { M model = loop.getMostRecentModel(); return model != null ? model : startModel; } 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 { @Nonnull public final M getModel() { M model = loop.getMostRecentModel(); return model != null ? model : startModel; } 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);  }