A value rebuilt only when one of its deps changes by identity — a
deterministic keyed memo. useMemo may discard and recompute, and the
watch-set getter / observer observe* calls return fresh objects each render,
so we key on stable primitives + identities instead. Rebuilding a store swaps
its subscribe/getSnapshot identity, so useSyncExternalStore resubscribes
exactly when the watched target actually changes.
A value rebuilt only when one of its
depschanges by identity — a deterministic keyed memo.useMemomay discard and recompute, and the watch-set getter / observerobserve*calls return fresh objects each render, so we key on stable primitives + identities instead. Rebuilding a store swaps itssubscribe/getSnapshotidentity, souseSyncExternalStoreresubscribes exactly when the watched target actually changes.