Code Patterns
📁 For comprehensive patterns and implementation guides, visit: Pattern Collection
This section has been reorganized into the dedicated patterns directory with clear categorization:
🎯 Core Framework Patterns
- Action Only Pattern - Pure action dispatching
- Store Only Pattern - Type-safe state management
- RefContext Pattern - Zero re-render DOM manipulation
🏗️ Architecture Patterns
- Pattern Composition - Combining patterns for complex apps
- MVVM Architecture - Single domain architectural layers
- Domain Context Architecture - Multi-domain business separation
⚡ Advanced Patterns
- Async Patterns - Real-time state, element waiting, timeout protection
Migration Note: All individual pattern files have been consolidated and organized. Please use the patterns directory for the most up-to-date documentation.
Quick Reference
Essential Rules
✅ Do
- Use
useCallbackfor handlers with useWaitForRefs - Access real-time state with
store.getValue() - Handle errors with try-catch
- Test both mounted/unmounted scenarios
❌ Don't
- Use direct DOM queries (
document.getElementById) - Rely on component scope values in handlers
- Ignore error handling
- Skip timeout protection for critical paths