Package com.spotify.mobius.rx
Class RxEventSources
- java.lang.Object
-
- com.spotify.mobius.rx.RxEventSources
-
public final class RxEventSources extends java.lang.ObjectContains utility methods for converting back and forth betweenObservables andEventSources.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E> com.spotify.mobius.EventSource<E>fromObservables(rx.Observable<E>... observables)Create an event source from the given RxJava streams.static <E> rx.Observable<E>toObservable(com.spotify.mobius.EventSource<E> eventSource, rx.Emitter.BackpressureMode backpressureMode)Create an observable from the given event source.
-
-
-
Method Detail
-
fromObservables
@SafeVarargs public static <E> com.spotify.mobius.EventSource<E> fromObservables(rx.Observable<E>... observables)
Create an event source from the given RxJava streams.All streams must be mapped to your event type.
- Type Parameters:
E- the event type- Parameters:
observables- the observables you want to include in this event source- Returns:
- an EventSource based on the provided observables
-
toObservable
public static <E> rx.Observable<E> toObservable(com.spotify.mobius.EventSource<E> eventSource, rx.Emitter.BackpressureMode backpressureMode)Create an observable from the given event source.- Type Parameters:
E- the event type- Parameters:
eventSource- the eventSource you want to convert to an observable- Returns:
- an Observable based on the provided event source
-
-