Guides
•2 min read
Guides
Practical, copy-paste recipes for common patterns – loading states, auth flows, shopping carts, and more.
Core Patterns
Patterns you need in virtually every project.
| Guide | What You'll Build |
|---|---|
| Loading & Error States | Track loading, error, and success across concurrent async operations |
| Authentication Flow | Login, logout, session validation, and automatic token refresh |
| Optimistic Updates | Instant UI updates with automatic rollback on server failure |
| Shopping Cart Rules | Quantity limits, coupon validation, and auth-gated checkout |
| Multi-Step Form Wizard | Constraint-gated step advancement with persistence and async validation |
Multi-Module & Architecture
Scaling beyond one module with cross-module patterns.
| Guide | What You'll Build |
|---|---|
| Async Chains Across Modules | Cross-module after chains: auth → permissions → dashboard data |
| Role-Based Permissions | RBAC with derivation composition and dynamic constraint disable |
| Batch Mutations | Multi-field updates that never expose intermediate states |
| Debounce Constraints | Prevent constraints from firing too frequently during rapid input |
Testing & Debugging
| Guide | What You'll Build |
|---|---|
| Test Async Chains | Deterministic testing of multi-step constraint-resolver flows |
| Debug with Time-Travel | Step-by-step debugging when constraints aren't firing as expected |
How These Guides Work
Each guide follows the same structure:
- The Problem – what goes wrong without the pattern
- The Solution – complete, working code you can copy
- Step by Step – what each piece does and why
- Common Variations – alternate approaches and edge cases
- Related – links to concept pages and API reference
Next Steps
- New to Directive? Start with Quick Start and Core Concepts
- Not sure which primitive to use? See Choosing Primitives
- Need API details? See the API Reference
- Looking for examples? See Examples

