Method Create
- Namespace
- SodaFlow.Collections
- Assembly
- SodaFlow.Core.Collections.dll
Create(Func<TIdentity, TKey>, IEnumerable<Item<TIdentity, TState>>, params Stream<CollectionEdit<TKey, TIdentity, TState>>[])
Defines a collection from its initial contents and each stream that edits it. There is no imperative entry point. This construction sets the code that can change the collection, and a reader finds all of it in one position.
public static ReactiveCollection<TKey, TIdentity, TState> Create(Func<TIdentity, TKey> keySelector, IEnumerable<Item<TIdentity, TState>> initialItems, params Stream<CollectionEdit<TKey, TIdentity, TState>>[] editStreams)
Parameters
keySelectorFunc<TIdentity, TKey>Makes the key of an item from its immutable part.
initialItemsIEnumerable<Item<TIdentity, TState>>The collection's initial contents.
editStreamsStream<CollectionEdit<TKey, TIdentity, TState>>[]Each stream that edits the collection.
Returns
- ReactiveCollection<TKey, TIdentity, TState>
The collection.
Remarks
Use the lifting factories of CollectionEdit<TKey, TIdentity, TState> to change a domain stream into edits. Where an edit uses a value from the collection, close the cycle with a stream loop at the call, and do not use a sink.
Create(Func<TIdentity, TKey>, IEqualityComparer<TKey>, IEnumerable<Item<TIdentity, TState>>, params Stream<CollectionEdit<TKey, TIdentity, TState>>[])
Defines a collection from its initial contents and each stream that edits it. There is no imperative entry point. This construction sets the code that can change the collection, and a reader finds all of it in one position.
public static ReactiveCollection<TKey, TIdentity, TState> Create(Func<TIdentity, TKey> keySelector, IEqualityComparer<TKey> keyEqualityComparer, IEnumerable<Item<TIdentity, TState>> initialItems, params Stream<CollectionEdit<TKey, TIdentity, TState>>[] editStreams)
Parameters
keySelectorFunc<TIdentity, TKey>Makes the key of an item from its immutable part.
keyEqualityComparerIEqualityComparer<TKey>The equality comparer for keys.
initialItemsIEnumerable<Item<TIdentity, TState>>The collection's initial contents.
editStreamsStream<CollectionEdit<TKey, TIdentity, TState>>[]Each stream that edits the collection.
Returns
- ReactiveCollection<TKey, TIdentity, TState>
The collection.
Remarks
Use the lifting factories of CollectionEdit<TKey, TIdentity, TState> to change a domain stream into edits. Where an edit uses a value from the collection, close the cycle with a stream loop at the call, and do not use a sink.
Create(Func<TIdentity, TKey>, Cell<IEnumerable<Item<TIdentity, TState>>>, params Stream<CollectionEdit<TKey, TIdentity, TState>>[])
Defines a collection from its initial contents and each stream that edits it. There is no imperative entry point. This construction sets the code that can change the collection, and a reader finds all of it in one position.
public static ReactiveCollection<TKey, TIdentity, TState> Create(Func<TIdentity, TKey> keySelector, Cell<IEnumerable<Item<TIdentity, TState>>> initialItems, params Stream<CollectionEdit<TKey, TIdentity, TState>>[] editStreams)
Parameters
keySelectorFunc<TIdentity, TKey>Makes the key of an item from its immutable part.
initialItemsCell<IEnumerable<Item<TIdentity, TState>>>The collection's initial contents, sampled lazily.
editStreamsStream<CollectionEdit<TKey, TIdentity, TState>>[]Each stream that edits the collection.
Returns
- ReactiveCollection<TKey, TIdentity, TState>
The collection.
Remarks
Use the lifting factories of CollectionEdit<TKey, TIdentity, TState> to change a domain stream into edits. Where an edit uses a value from the collection, close the cycle with a stream loop at the call, and do not use a sink.
Create(Func<TIdentity, TKey>, IEqualityComparer<TKey>, Cell<IEnumerable<Item<TIdentity, TState>>>, params Stream<CollectionEdit<TKey, TIdentity, TState>>[])
Defines a collection from its initial contents and each stream that edits it. There is no imperative entry point. This construction sets the code that can change the collection, and a reader finds all of it in one position.
public static ReactiveCollection<TKey, TIdentity, TState> Create(Func<TIdentity, TKey> keySelector, IEqualityComparer<TKey> keyEqualityComparer, Cell<IEnumerable<Item<TIdentity, TState>>> initialItems, params Stream<CollectionEdit<TKey, TIdentity, TState>>[] editStreams)
Parameters
keySelectorFunc<TIdentity, TKey>Makes the key of an item from its immutable part.
keyEqualityComparerIEqualityComparer<TKey>The equality comparer for keys.
initialItemsCell<IEnumerable<Item<TIdentity, TState>>>The collection's initial contents, sampled lazily.
editStreamsStream<CollectionEdit<TKey, TIdentity, TState>>[]Each stream that edits the collection.
Returns
- ReactiveCollection<TKey, TIdentity, TState>
The collection.
Remarks
Use the lifting factories of CollectionEdit<TKey, TIdentity, TState> to change a domain stream into edits. Where an edit uses a value from the collection, close the cycle with a stream loop at the call, and do not use a sink.