public void Send(T val)
 {
     if (realtime)
     {
         ReactiveTimeInteractions.ExecuteAfterRealtimeDelay(delay, () => receiving.Send(val));
     }
     else
     {
         ReactiveTimeInteractions.ExecuteAfterDelay(delay, () => receiving.Send(val));
     }
 }
Example #2
0
        void Update()
        {
            var newVal = Calculate();

            if (EqualityComparer <TVal> .Default.Equals(newVal, currVal) == false)
            {
                currVal = newVal;
                changed.Send(currVal);
            }
        }
Example #3
0
 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,
         });
     }
 }
Example #4
0
 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
         });
     }
 }
Example #5
0
 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
         });
     }
 }
Example #6
0
 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
         });
     }
 }