What problem does it solve?
Developers working with ccstate in the vm0 platform repeatedly hit subtle bugs: floating promises in DOM handlers, functions silently executed instead of stored in state atoms, orphaned AbortSignals leaking polling loops, and manual HTTP error handling that duplicates framework behavior. This Skill codifies the correct patterns so these mistakes are avoided.
Core Features & Use Cases
- DOM Callback & Detach Patterns: Use
detach() with Reason.DomCallback in React views to handle fire-and-forget promises without lint errors or test cleanup leaks.
- Reactive Async Computeds: Replace imperative fetch-and-store commands with
computed(async ...) plus a reload counter, eliminating manual loading/error state.
- HTTP Error Handling with
accept: Enforce a single, type-narrowed way to handle API status codes with automatic toast and ApiError semantics.
- AbortSignal Lifecycle & Signal Factories: Define clear signal ownership hierarchies and factory functions so multiple feature instances coexist without global singleton conflicts.
- Use Case: When adding a new page that fetches agents and handles button clicks, follow the documented patterns to wire
pageSignal$, accept, and detach correctly on the first attempt.
Quick Start
Ask the assistant to review your ccstate signals code and apply the documented patterns for detach, accept, and AbortSignal ownership.