ta
TanStack
GitHub
ai
Workspace
GitHub
CI Pipeline Executions
Filtered
Runs
Demo
Insights
Compare tasks
Analytics
Sign in
Toggle sidebar
Overview
⌘K
ai
Loading workspace stats
Loading workspace insights...
Statistics interval
7 days
30 days
Latest CI Pipeline Executions
Status
Fix filter
Filter
Fuzzy
Filter range
Sort by
Sort by
Start time
Sort ascending
Sort descending
Succeeded
experiment/use-chat-client-store
7572089f refactor(ai-client,ai-react): expose ChatClient as an external store Promote the external-store shape out of the React hook and onto ChatClient itself, so every framework binding can share one subscribe/getSnapshot pair instead of re-wiring seven onXChange callbacks. ai-client: - Add ChatClientSnapshot (immutable projection of the reactive state) and ChatClientStore { subscribe, getSnapshot }, exported from the package. - ChatClient gains a `store` field backed by the existing setX mutators: each of setIsLoading/setStatus/setIsSubscribed/setConnectionStatus/ setSessionGenerating/setError and the messages handler now also calls emitStoreChange(), which rebuilds the cached snapshot and notifies listeners. - Named `store` (not `subscribe`) to avoid colliding with the existing live-subscription `subscribe()`. ai-react: - useChat drops the hook-local store from the previous rewrite and reads client.store via useSyncExternalStore. The hook no longer passes any onXChange callback — only genuine side-effect callbacks remain. The onXChange callbacks stay intact for existing (solid/vue/svelte/persistor) consumers; the store is additive. All 376 ai-client + 128 ai-react tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
by Tom Beckenham
T
Succeeded
experiment/use-chat-client-store
7572089f Merge ae5b6ca60394d66979a9a8c03f54e18fa533c385 into 0fce6f1f8c68ef7effd1213bdf91da1239030a17
by Tom Beckenham
T
Previous
Next