store-data-structures
Installation
SKILL.md
LobeHub Store Data Structures
How to structure data in Zustand stores for fast list rendering, multi-detail caching, and ergonomic optimistic updates.
Core Principles
✅ DO
- Separate List and Detail — different structures for list pages and detail pages
- Use Map for Details — cache multiple detail pages with
Record<string, Detail> - Use Array for Lists — simple arrays for list display
- Types from
@lobechat/types— never use@lobechat/databasetypes in stores - Distinguish List and Detail types — List types may have computed UI fields