AliasWatch

interface
utils/immutability.ts:109

Watches the freeze walk for one specific reference.

Exists to turn a dev-only heisenbug into a named warning. Because the freeze is deep and in place, anything a reducer stores **by reference** is frozen too — the event payload, a module-level default, a cached response. Mutating that object afterwards then throws, only in development, from a stack that has nothing to do with the store, and the same code works in production because the freeze is compiled out. Freezing it is not the mistake: an object reachable from state genuinely must not be mutated, or state changes behind the store's back. Keeping the reference is. The walk already visits every node, so recognising one of them costs an identity comparison and lets the store say so at the moment it happens.

Properties

NameTypeDescription
onFound() => voidCalled if watch is reachable from the value being frozen.
watchobjectThe reference to look for while freezing.