If the underlying store is mutable, keep a cached immutable snapshot and update it only when the store actually changes.
Question 19 of 20 in useSyncExternalStore Quiz