public static IRxVal <Tpl <A, A1, A2, A3, A4, A5> > zip <A, A1, A2, A3, A4, A5>( this IRxVal <A> ref1, IRxVal <A1> ref2, IRxVal <A2> ref3, IRxVal <A3> ref4, IRxVal <A4> ref5, IRxVal <A5> ref6 ) => RxVal.a( () => F.t(ref1.value, ref2.value, ref3.value, ref4.value, ref5.value, ref6.value), ObservableOpImpls.zip(ref1, ref2, ref3, ref4, ref5, ref6) );
/** Only emits events that pass the predicate. **/ public static IObservable <A> filter <A>( this IObservable <A> o, Fn <A, bool> predicate ) => Observable.a(ObservableOpImpls.filter(o, predicate));
/** * Maps events coming from this observable and emits events from returned futures. * * Does not emit value if future completes after observable is finished. **/ public static IObservable <B> flatMap <A, B>( this IObservable <A> o, Fn <A, Future <B> > mapper ) => Observable.a(ObservableOpImpls.flatMap(o, mapper));
/** Only emits events that return some. **/ public static IObservable <B> collect <A, B>( this IObservable <A> o, Fn <A, Option <B> > collector ) => Observable.a(ObservableOpImpls.collect(o, collector));
public static IRxVal <B> map <A, B>(this IRxVal <A> rx, Fn <A, B> mapper) => RxVal.a(() => mapper(rx.value), ObservableOpImpls.map(rx, mapper));
public static IRxVal <Tpl <A, B, C> > zip <A, B, C>( this IRxVal <A> rx, IRxVal <B> rx2, IRxVal <C> rx3 ) => RxVal.a( () => F.t(rx.value, rx2.value, rx3.value), ObservableOpImpls.zip(rx, rx2, rx3) );
public static IObservable <Tpl <A, B, C, D, E> > zip <A, B, C, D, E>( this IObservable <A> o, IObservable <B> o1, IObservable <C> o2, IObservable <D> o3, IObservable <E> o4 ) => Observable.a(ObservableOpImpls.zip(o, o1, o2, o3, o4));
public static IObservable <Tpl <A, B> > zip <A, B>(this IObservable <A> o, IObservable <B> other) => Observable.a(ObservableOpImpls.zip(o, other));
/** Maps events coming from this observable. **/ public static IObservable <B> map <A, B>( this IObservable <A> o, Fn <A, B> mapper ) => Observable.a(ObservableOpImpls.map(o, mapper));
/* Joins events, but discards the values. */ public static IObservable <Unit> joinDiscard <A, X>( this IObservable <A> o, IObservable <X> other ) => Observable.a(ObservableOpImpls.joinDiscard(o, other));
/** * Joins all events from all observables into one stream. **/ public static IObservable <A> joinAll <A>( this IEnumerable <IObservable <A> > observables, int count ) => Observable.a(ObservableOpImpls.joinAll(observables, count));
public static IObservable <A> joinAll <A>( this IObservable <A> o, IEnumerable <IObservable <A> > others, int othersCount ) => Observable.a(ObservableOpImpls.joinAll(o, others, othersCount));
/** * Joins events of two observables returning an observable which emits * events when either observable emits them. **/ public static IObservable <A> join <A, B>( this IObservable <A> o, IObservable <B> other ) where B : A => Observable.a(ObservableOpImpls.join(o, other));
public static IObservable <C> timeBuffer <A, C>( this IObservable <A> o, Duration duration, IObservableQueue <Tpl <A, float>, C> queue, TimeScale timeScale = TimeScale.Realtime ) => Observable.a(ObservableOpImpls.timeBuffer(o, duration, queue, timeScale));
public static IObservable <C> buffer <A, C>( this IObservable <A> o, int size, IObservableQueue <A, C> queue ) => Observable.a(ObservableOpImpls.buffer(o, size, queue));
// Skips `count` values from the stream. public static IObservable <A> skip <A>(this IObservable <A> o, uint count) => Observable.a(ObservableOpImpls.skip(o, count));
// If several events are emitted per same frame, only emit last one in late update. // TODO: test, but how? Can't do async tests in unity. public static IObservable <A> oncePerFrame <A>(this IObservable <A> o) => Observable.a(ObservableOpImpls.oncePerFrame(o));
/** * Only emits an event if other event was not emmited in specified * time range. **/ // TODO: test with integration tests public static IObservable <A> onceEvery <A>( this IObservable <A> o, Duration duration, TimeScale timeScale = TimeScale.Realtime ) => Observable.a(ObservableOpImpls.onceEvery(o, duration, timeScale));
public static IObservable <Tpl <A, B, C> > zip <A, B, C>( this IObservable <A> o, IObservable <B> o1, IObservable <C> o2 ) => Observable.a(ObservableOpImpls.zip(o, o1, o2));
/** * Waits until `count` events are emmited within a single `timeframe` * seconds window and emits a read only linked list of * (element, emission time) Tpls with emmission time. **/ public static IObservable <ReadOnlyLinkedList <Tpl <A, float> > > withinTimeframe <A>( this IObservable <A> o, int count, Duration timeframe, TimeScale timeScale = TimeScale.Realtime ) => ObservableOpImpls.withinTimeframe(o, count, timeframe, timeScale, Observable.a);
public static IObservable <Tpl <A, A1, A2, A3, A4, A5> > zip <A, A1, A2, A3, A4, A5>( this IObservable <A> o, IObservable <A1> o1, IObservable <A2> o2, IObservable <A3> o3, IObservable <A4> o4, IObservable <A5> o5 ) => Observable.a(ObservableOpImpls.zip(o, o1, o2, o3, o4, o5));
/** Delays each event. **/ public static IObservable <A> delayed <A>( this IObservable <A> o, Duration delay ) => Observable.a(ObservableOpImpls.delayed(o, delay));
public static IRxVal <Tpl <A, B, C, D, E> > zip <A, B, C, D, E>( this IRxVal <A> ref1, IRxVal <B> ref2, IRxVal <C> ref3, IRxVal <D> ref4, IRxVal <E> ref5 ) => RxVal.a( () => F.t(ref1.value, ref2.value, ref3.value, ref4.value, ref5.value), ObservableOpImpls.zip(ref1, ref2, ref3, ref4, ref5) );
// Returns pairs of (old, new) values when they are changing. // If there was no events before, old may be None. public static IObservable <Tpl <Option <A>, A> > changesOpt <A>( this IObservable <A> o, Fn <A, A, bool> areEqual = null ) => Observable.a(ObservableOpImpls.changesOpt(o, areEqual ?? EqComparer <A> .Default.Equals));
// Emits new values. Always emits first value and then emits changed values. public static IObservable <A> changedValues <A>( this IObservable <A> o, Fn <A, A, bool> areEqual = null ) => Observable.a(ObservableOpImpls.changedValues(o, areEqual ?? EqComparer <A> .Default.Equals));
/** * Discards values that this observable emits, turning it into event * source that does not carry data with it. **/ public static IObservable <Unit> discardValue <A>(this IObservable <A> o) => Observable.a(ObservableOpImpls.discardValue(o));