cliffhall
8f3619f618
docs(core): correct the useStoreSnapshot caller contract
...
Copilot review round 2.
The contract claimed an unstable `read`/`whenAbsent` trips React's "The
result of getSnapshot should be cached" error. It does not. Measured on
React 19: an inline `read` closure throws nothing, logs nothing, and forces
no extra render pass. React's dev check calls getSnapshot twice within a
single render, where the closure is unchanged, so the cache answers both
calls identically and the warning never fires.
The real cost is quiet — a fresh value every render, defeating downstream
useMemo/React.memo/effect deps — which is a better reason to state the
contract than an error that never arrives.
Also stop requiring module scope for every fallback. A primitive
`whenAbsent` (`false`, `undefined`, `"disconnected"`) is stable under
Object.is and is passed inline throughout these hooks, so the rule
contradicted the code it was describing. Only object/array fallbacks need a
constant, which is what NO_TOOLS and NO_PAGINATION are.
Signed-off-by: cliffhall <cliff@futurescale.com>
2026-08-29 02:42:03 -04:00
..
pagination.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
useClientSettingsDraft.ts
chore: close quality-gate coverage gaps ( #1689 ) ( #1766 )
2026-07-24 17:20:12 -04:00
useEmaIdpLoginState.ts
fix(auth): guard OAuth-storage async paths against unhandled rejections
2026-07-08 10:59:40 -04:00
useFetchRequestLog.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
useInitialConfig.ts
fix(auth): stop blaming the passphrase for a corrupt payload, and refresh the stale docs
2026-08-22 23:08:52 -04:00
useInspectorClient.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
useListError.ts
fix: surface list-fetch failures in paginated mode ( #1998 )
2026-08-17 20:40:23 -04:00
useManagedPrompts.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
useManagedRequestorTasks.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
useManagedResources.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
useManagedResourceTemplates.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
useManagedTools.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
useMessageLog.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
usePagedPrompts.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
usePagedRequestorTasks.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
usePagedResources.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
usePagedResourceTemplates.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
usePagedTools.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
usePendingClientRequests.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
useResourceSubscriptions.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
useServers.ts
fix(web): don't roll back an optimistic setting a failed reload didn't undo
2026-08-23 09:39:47 -04:00
useSettingsDraft.ts
fix(servers): make settings form re-render on every keystroke ( #1361 ) ( #1362 )
2026-05-26 13:42:14 -04:00
useStderrLog.ts
fix(core): read state stores during render instead of re-syncing in an effect
2026-08-29 02:07:53 -04:00
useStoreSnapshot.ts
docs(core): correct the useStoreSnapshot caller contract
2026-08-29 02:42:03 -04:00