public void Send(T val) { if (realtime) { ReactiveTimeInteractions.ExecuteAfterRealtimeDelay(delay, () => receiving.Send(val)); } else { ReactiveTimeInteractions.ExecuteAfterDelay(delay, () => receiving.Send(val)); } }
void Update() { var newVal = Calculate(); if (EqualityComparer <TVal> .Default.Equals(newVal, currVal) == false) { currVal = newVal; changed.Send(currVal); } }
public static void OnItemInserted(T item, EventStream <ReactiveCollectionEvent <T> > up, int index) { if (up != null) { up.Send(new ReactiveCollectionEvent <T> { type = ReactiveCollectionEventType.Insert, newItem = item, position = index, }); } }
public static void OnItemsReset(IReadOnlyList <T> newData, IReadOnlyList <T> oldData, EventStream <ReactiveCollectionEvent <T> > up) { if (up != null) { up.Send(new ReactiveCollectionEvent <T> { type = ReactiveCollectionEventType.Reset, oldData = oldData, newData = newData }); } }
public static void OnItemRemovedAt(int index, EventStream <ReactiveCollectionEvent <T> > up, T item) { if (up != null) { up.Send(new ReactiveCollectionEvent <T> { type = ReactiveCollectionEventType.Remove, position = index, oldItem = item }); } }
public static void OnItemSet(int index, T newItem, T oldItem, EventStream <ReactiveCollectionEvent <T> > up) { if (up != null) { up.Send(new ReactiveCollectionEvent <T> { type = ReactiveCollectionEventType.Set, position = index, newItem = newItem, oldItem = oldItem }); } }