Interface IConnectableCache<TObject, TKey>
- Namespace
- DynamicData
- Assembly
- DynamicData.dll
A cache for observing and querying in memory data.
public interface IConnectableCache<TObject, TKey> where TObject : notnull where TKey : notnull
Type Parameters
TObject
The type of the object.
TKey
The type of the key.
Properties
CountChanged
Gets a count changed observable starting with the current count.
IObservable<int> CountChanged { get; }
Property Value
Methods
Connect(Func<TObject, bool>?, bool)
Returns a filtered stream of cache changes preceded with the initial filtered state.
IObservable<IChangeSet<TObject, TKey>> Connect(Func<TObject, bool>? predicate = null, bool suppressEmptyChangeSets = true)
Parameters
predicate
Func<TObject, bool>The result will be filtered using the specified predicate.
suppressEmptyChangeSets
boolBy default, empty change sets are not emitted. Set this value to false to emit empty change sets.
Returns
- IObservable<IChangeSet<TObject, TKey>>
An observable that emits the change set.
Preview(Func<TObject, bool>?)
Returns a filtered stream of cache changes. Unlike Connect(), the returned observable is not prepended with the caches initial items.
IObservable<IChangeSet<TObject, TKey>> Preview(Func<TObject, bool>? predicate = null)
Parameters
Returns
- IObservable<IChangeSet<TObject, TKey>>
An observable that emits the change set.
Watch(TKey)
Returns an observable of any changes which match the specified key. The sequence starts with the initial item in the cache (if there is one).
IObservable<Change<TObject, TKey>> Watch(TKey key)
Parameters
key
TKeyThe key.
Returns
- IObservable<Change<TObject, TKey>>
An observable that emits the change set.