src/stores/README.md
The store files (sessionStore.ts and agentStore.ts) provide examples of how to implement global state management with Zustand for the opcode application.
These stores are example implementations that would need to be adapted to match the actual API interface. The current API in lib/api.ts has different method names and signatures than what was assumed in the store implementations.
import { useSessionStore } from '@/stores/sessionStore';
function MyComponent() {
const { sessions, fetchSessions } = useSessionStore();
useEffect(() => {
fetchSessions();
}, []);
return <div>{sessions.length} sessions</div>;
}