Table of Contents

Method ChangeFor

Namespace
SodaFlow.Collections
Assembly
SodaFlow.Collections.dll

ChangeFor<TKey, TIdentity, TState>(ItemChange<TKey, TIdentity, TState>, TKey)

The result of a change on one key. The two levels are deliberate and they give different data. The outer Maybe<T> gives if the change named the key, and no value means no event for this observer. The inner Maybe<T> gives if the collection has the key after the change, thus a removal comes as a value that holds no value.

[Pure]
public static Maybe<Maybe<TState>> ChangeFor<TKey, TIdentity, TState>(this ItemChange<TKey, TIdentity, TState> change, TKey key) where TKey : notnull where TIdentity : notnull

Parameters

change ItemChange<TKey, TIdentity, TState>

The change to read.

key TKey

The key to read.

Returns

Maybe<Maybe<TState>>

The change to that key, when there is one.

Type Parameters

TKey

The type of the keys.

TIdentity

The type of the immutable part of an item.

TState

The type of the mutable part of an item.