StreamMap<K, V>.from constructor

StreamMap<K, V>.from(
  1. Map<K, V> other, {
  2. OnUpdate<Map<K, V>>? onUpdate,
  3. OnEvent<CollectionEvent<K, V>>? onEvent,
  4. OnChange<CollectionChangeEvent<K, V>>? onChange,
})

Creates a StreamMap wrapped around a LinkedHashMap instance that contains all key/value pairs of other.

The keys must all be instances of K and the values of V. The other map itself can have any type.

A LinkedHashMap requires the keys to implement compatible operator== and hashCode, and it allows null as a key. It iterates in key insertion order.

Implementation

factory StreamMap.from(
  Map<K, V> other, {
  OnUpdate<Map<K, V>>? onUpdate,
  OnEvent<CollectionEvent<K, V>>? onEvent,
  OnChange<CollectionChangeEvent<K, V>>? onChange,
}) {
  return StreamMap<K, V>(
    value: Map<K, V>.from(other),
    onUpdate: onUpdate,
    onEvent: onEvent,
    onChange: onChange,
  );
}