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

            if (EqualityComparer <TVal> .Default.Equals(newVal, currVal) == false)
            {
                currVal = newVal;
                changed.Send(currVal);
            }
        }
Exemplo n.º 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,
         });
     }
 }
Exemplo n.º 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
         });
     }
 }
Exemplo n.º 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
         });
     }
 }
Exemplo n.º 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
         });
     }
 }