angular-state-management
Implement Angular State Management
Angular state management is complex with multiple solutions. This skill provides decision frameworks and implementation patterns for Signals, NgRx, Component Stores, and RxJS patterns to build maintainable applications.
Descargar el ZIP de la skill
Subir en Claude
Ve a Configuración → Capacidades → Skills → Subir skill
Activa y empieza a usar
Pruébalo
Usando "angular-state-management". When should I use Signals vs NgRx Store?
Resultado esperado:
- Use Signals when: Simple local state, shared state between few components, computed derived values, lightweight solutions needed
- Use NgRx Store when: Complex cross-feature dependencies, time-travel debugging needed, strict unidirectional data flow required, large team coordination
Usando "angular-state-management". Create a user state service with Signals
Resultado esperado:
- Service includes: private writable signals, readonly public signals using asReadonly(), computed values for derived state, methods for state updates
Auditoría de seguridad
SeguroStatic analysis flagged 70 potential issues. Manual review confirms all findings are false positives. The 'Ruby/shell backtick execution' findings are triggered by markdown code fences and TypeScript template literals. 'Weak cryptographic algorithm' is triggered by words like 'sha' in 'shared' and 'source'. Network-related findings are legitimate documentation URLs and code examples. This is a genuine Angular state management documentation skill with no security concerns.
Puntuación de calidad
Lo que puedes crear
Choose the Right State Solution
Get guidance on when to use Signals for simple state, Component Stores for feature-scoped state, or NgRx Store for enterprise applications with complex flows.
Implement Modern Signal Patterns
Learn to create Signal-based services with computed values, toSignal conversion from Observables, and proper immutability patterns.
Set Up NgRx SignalStore
Configure NgRx SignalStore with withState, withMethods, withComputed for type-safe feature state management without boilerplate.
Prueba estos prompts
I have an Angular app with [describe your use case]. Should I use Signals, Component Store, or NgRx? What factors should influence my decision?
Create a Signal-based service for managing [describe state]. Include writable signals, computed values, and methods for updating state.
Set up NgRx Store for [describe feature]. Include actions with createActionGroup, a reducer, selectors, and effects for async operations.
Convert this RxJS BehaviorSubject service to modern Angular Signals. Show the before and after patterns with proper reactivity.
Mejores prácticas
- Prefer Signals for new Angular applications - they are the recommended modern approach
- Use computed() for all derived state to ensure automatic updates
- Colocate state with the feature that uses it rather than global state
- Use NgRx when you need time-travel debugging, strict patterns, or enterprise coordination
Evitar
- Avoid mutating signals directly - always use set() or update() methods
- Do not over-globalize state - keep local when possible to reduce complexity
- Avoid mixing RxJS and Signals without clear bridging patterns
- Do not subscribe in components for state - use signals in templates directly
Preguntas frecuentes
What is the simplest state management in Angular?
When should I use NgRx over Signals?
Can I mix Signals with RxJS?
What is NgRx SignalStore?
How do I migrate from BehaviorSubject to Signals?
Does this skill write code for me?
Detalles del desarrollador
Autor
sickn33Licencia
MIT
Repositorio
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/angular-state-managementRef.
main
Estructura de archivos