public final class RxMobius
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RxMobius.SubtypeEffectHandlerBuilder<F,E>
Builder for a type-routing effect handler.
|
| Modifier and Type | Method and Description |
|---|---|
static <M,E,F> com.spotify.mobius.MobiusLoop.Builder<M,E,F> |
loop(com.spotify.mobius.Update<M,E,F> update,
rx.Observable.Transformer<F,E> effectHandler)
Create a
MobiusLoop.Builder to help you configure a MobiusLoop before starting it. |
static <M,E,F> rx.Observable.Transformer<E,M> |
loopFrom(com.spotify.mobius.MobiusLoop.Factory<M,E,F> loopFactory,
M startModel)
Create an observable transformer that starts from a given model.
|
static <M,E,F> rx.Observable.Transformer<E,M> |
loopFrom(com.spotify.mobius.MobiusLoop.Factory<M,E,F> loopFactory,
M startModel,
java.util.Set<F> startEffects)
Create an observable transformer that starts from a given model and given effects.
|
static <F,E> RxMobius.SubtypeEffectHandlerBuilder<F,E> |
subtypeEffectHandler()
Create an
RxMobius.SubtypeEffectHandlerBuilder for handling effects based on their type. |
public static <M,E,F> rx.Observable.Transformer<E,M> loopFrom(com.spotify.mobius.MobiusLoop.Factory<M,E,F> loopFactory,
M startModel)
Every time the resulting observable is subscribed to, a new MobiusLoop will be started from the given model.
M - the model typeE - the event typeF - the effect typeloopFactory - gets invoked for each subscription, to create a new MobiusLoop instancestartModel - the starting point for each new looppublic static <M,E,F> rx.Observable.Transformer<E,M> loopFrom(com.spotify.mobius.MobiusLoop.Factory<M,E,F> loopFactory,
M startModel,
java.util.Set<F> startEffects)
Every time the resulting observable is subscribed to, a new MobiusLoop will be started from the given model and the given effects.
M - the model typeE - the event typeF - the effect typeloopFactory - gets invoked for each subscription, to create a new MobiusLoop instancestartModel - the starting point for each new loopstartEffects - the starting effects for each new looppublic static <M,E,F> com.spotify.mobius.MobiusLoop.Builder<M,E,F> loop(com.spotify.mobius.Update<M,E,F> update,
rx.Observable.Transformer<F,E> effectHandler)
MobiusLoop.Builder to help you configure a MobiusLoop before starting it.
Once done configuring the loop you can start the loop using MobiusLoop.Factory#startFrom(Object).
M - the model typeE - the event typeF - the effect typeupdate - the Update function of the loopeffectHandler - the Observable.Transformer effect handler of the loopMobiusLoop.Builder instance that you can further configure before starting
the looppublic static <F,E> RxMobius.SubtypeEffectHandlerBuilder<F,E> subtypeEffectHandler()
RxMobius.SubtypeEffectHandlerBuilder for handling effects based on their type.F - the effect typeE - the event type