set method
Implementation
void set(
String name,
Object? value, {
bool pristine = false,
bool local = true,
}) {
if (local) _localWrites.add(name);
if (pristine) {
_pristine.add(name);
} else {
_pristine.remove(name);
}
final existing = _state[name];
if (_state.containsKey(name) && Js.objectIs(existing, value)) return;
if (value is Map && existing is Map && value.length == existing.length) {
if (value.keys.every(
(k) => existing.containsKey(k) && Js.objectIs(value[k], existing[k]),
)) {
return;
}
}
_state[name] = value;
_notify();
}