Exemplo n.º 1
0
 /// <summary>
 /// Subscribes to a StateCollectionReader and exposes it as an observable of DiffResult. Note that each IChange
 /// is converted into a single DiffResult, so one StateCollectionReader Change event may yield many DiffResult instances.
 /// You can use the result of this method to apply changes onto an observable collection
 /// </summary>
 public static IObservable <DiffResults <T> > ObserveDiffs <T, TOwner>(this IStateCollectionReader <T> source, TOwner owner)
     where TOwner : INotifyDisposable
 {
     return(source.ObserveChanges(owner).ToDiffResult());
 }
Exemplo n.º 2
0
 /// <summary>
 /// Subscribes to a StateCollectionReader and exposes it as collection of (immuable) list values
 /// </summary>
 public static IObservable <ImmutableList <T> > ObserveValues <T, TOwner>(this IStateCollectionReader <T> source, TOwner owner)
     where TOwner : INotifyDisposable
 {
     return(source.ObserveChanges(owner).Select(changeSet => changeSet.NewValues.ToImmutableList()));
 }