@Test public void shouldInstantiateBeginnerWithMinimumParams() throws Exception { MobiusLoop<String, Integer, ?> loop = MobiusExtras.beginnerLoop(BEGINNER_UPDATE).startFrom(MY_MODEL); loop.dispatchEvent(8); await().atMost(Duration.ofSeconds(1)).until(loop::getMostRecentModel, is("start8")); }
@Nonnull public static <M, E> MobiusLoop.Builder<M, E, ?> beginnerLoop(final BiFunction<M, E, M> update) { return loop( new Update<M, E, Object>() { @Nonnull @Override public Next<M, Object> update(M model, E event) { return Next.next(update.apply(model, event)); } }, (Connectable<Object, E>) NOOP_CONNECTABLE); }
MobiusExtras { @Nonnull public static <M, E> MobiusLoop.Builder<M, E, ?> beginnerLoop(final BiFunction<M, E, M> update) { return loop( new Update<M, E, Object>() { @Nonnull @Override public Next<M, Object> update(M model, E event) { return Next.next(update.apply(model, event)); } }, (Connectable<Object, E>) NOOP_CONNECTABLE); } }
MobiusExtras { @Nonnull public static <M, E> MobiusLoop.Builder<M, E, ?> beginnerLoop(final BiFunction<M, E, M> update) { return loop( new Update<M, E, Object>() { @Nonnull @Override public Next<M, Object> update(M model, E event) { return Next.next(update.apply(model, event)); } }, (Connectable<Object, E>) NOOP_CONNECTABLE); } private  MobiusExtras(); }
MobiusExtras { @Nonnull public static <M, E> MobiusLoop.Builder<M, E, ?> beginnerLoop(final BiFunction<M, E, M> update) { return loop( new Update<M, E, Object>() { @Nonnull @Override public Next<M, Object> update(M model, E event) { return Next.next(update.apply(model, event)); } }, (Connectable<Object, E>) NOOP_CONNECTABLE); } private  MobiusExtras(); @Nonnull static MobiusLoop.Builder<M, E, ?> beginnerLoop(final BiFunction<M, E, M> update); }
MobiusExtras { @Nonnull public static <M, E> MobiusLoop.Builder<M, E, ?> beginnerLoop(final BiFunction<M, E, M> update) { return loop( new Update<M, E, Object>() { @Nonnull @Override public Next<M, Object> update(M model, E event) { return Next.next(update.apply(model, event)); } }, (Connectable<Object, E>) NOOP_CONNECTABLE); } private  MobiusExtras(); @Nonnull static MobiusLoop.Builder<M, E, ?> beginnerLoop(final BiFunction<M, E, M> update);  }