Class ReactiveCollection
- Namespace
- SodaFlow.Collections
- Assembly
- SodaFlow.Core.Collections.dll
Makes collections whose identities hold their own key. Thus, a caller can omit the selector of each other overload.
[PublicAPI]
public static class ReactiveCollection
- Inheritance
-
ReactiveCollection
- Inherited Members
Remarks
This is a second class beside
ReactiveCollection<TKey, TIdentity, TState> and not more
overloads on that class, because a static method cannot add a
constraint to the type parameters of its own class.
TIdentity : IIdentity<TKey> is the one difference here.
The shape is the shape of Cell beside Cell<T>.
The compiler infers TKey from the edit streams. Type inference
does not read a constraint, thus it cannot infer TKey from
IIdentity<TKey> alone.
A construction with no edit stream must name the three type arguments,
or must use the overloads with a selector.
Methods
- Create<TKey, TIdentity, TState>(IEnumerable<Item<TIdentity, TState>>, params Stream<CollectionEdit<TKey, TIdentity, TState>>[])
Defines a collection from its initial contents and each stream that edits it, and this code takes the key of each item from the identity.