StreamMap<K, V>.of constructor

StreamMap<K, V>.of(
  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 with the same keys and values as other.

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.of(
  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>.of(other),
    onUpdate: onUpdate,
    onEvent: onEvent,
    onChange: onChange,
  );
}