operator []= method

  1. @override
void operator []=(
  1. K key,
  2. V value
)
override

Sets the value associated with the given key.

Updates the map with the key-value pair and notifies all subscribers. This operation triggers reactive updates.

Implementation

@override
void operator []=(K key, V value) {
  if (peek.containsKey(key) && peek[key] == value) {
    peek[key] = value;
  } else {
    peek[key] = value;
    notify(true);
  }
}