コード例 #1
0
 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)
     );
コード例 #2
0
 /** 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));
コード例 #3
0
 /**
  * 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));
コード例 #4
0
 /** 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));
コード例 #5
0
 public static IRxVal <B> map <A, B>(this IRxVal <A> rx, Fn <A, B> mapper) =>
 RxVal.a(() => mapper(rx.value), ObservableOpImpls.map(rx, mapper));
コード例 #6
0
 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)
     );
コード例 #7
0
 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));
コード例 #8
0
 public static IObservable <Tpl <A, B> > zip <A, B>(this IObservable <A> o, IObservable <B> other) =>
 Observable.a(ObservableOpImpls.zip(o, other));
コード例 #9
0
 /** 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));
コード例 #10
0
 /* 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));
コード例 #11
0
 /**
  * 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));
コード例 #12
0
 public static IObservable <A> joinAll <A>(
     this IObservable <A> o, IEnumerable <IObservable <A> > others, int othersCount
     ) => Observable.a(ObservableOpImpls.joinAll(o, others, othersCount));
コード例 #13
0
 /**
  * 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));
コード例 #14
0
 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));
コード例 #15
0
 public static IObservable <C> buffer <A, C>(
     this IObservable <A> o, int size, IObservableQueue <A, C> queue
     ) => Observable.a(ObservableOpImpls.buffer(o, size, queue));
コード例 #16
0
 // Skips `count` values from the stream.
 public static IObservable <A> skip <A>(this IObservable <A> o, uint count) =>
 Observable.a(ObservableOpImpls.skip(o, count));
コード例 #17
0
 // 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));
コード例 #18
0
 /**
  * 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));
コード例 #19
0
 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));
コード例 #20
0
 /**
  * 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);
コード例 #21
0
 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));
コード例 #22
0
 /** Delays each event. **/
 public static IObservable <A> delayed <A>(
     this IObservable <A> o, Duration delay
     ) => Observable.a(ObservableOpImpls.delayed(o, delay));
コード例 #23
0
 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)
     );
コード例 #24
0
 // 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));
コード例 #25
0
 // 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));
コード例 #26
0
 /**
  * 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));