angular-state-management

Implement Angular state management using Signals, NgRx, and RxJS patterns.

1|Updated Aug 17, 2025
One-click install
npx skills add https://github.com/ratnesh-maurya/mdconverter --skill angular-state-management-ratnesh-maurya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-state-management
Source: https://github.com/ratnesh-maurya/mdconverter/tree/main/.claude/skills/angular-state-management
Command: npx skills add https://github.com/ratnesh-maurya/mdconverter --skill angular-state-management-ratnesh-maurya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Choosing and implementing the right state management approach in Angular is confusing, with options ranging from Signals to NgRx to RxJS, and teams often over-engineer simple state or under-engineer complex global state. ## Core Features & Use Cases - Decision Frameworks: Provides state category tables and selection criteria to choose between Signal services, NgRx SignalStore, NgRx Store, and ComponentStore. - Implementation Patterns: Includes complete TypeScript examples for signal services, feature stores, NgRx reducers/effects/selectors, and server state with optimistic updates. - Migration Guides: Shows how to migrate from BehaviorSubject-based services to Signals and bridge Signals with RxJS using toSignal and toObservable. - Use Case: When building a product catalog feature, use the NgRx SignalStore pattern with computed filtered products and patchState methods to manage loading, filtering, and list updates. ## Quick Start Ask the AI to set up a Signal-based store for a feature in your Angular app, such as "create a signal store for managing my shopping cart with add, remove, and total price computed."

Frequently Asked Questions about angular-state-management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between Signals and NgRx for Angular state management?

Use Signal services for small apps with simple shared state, ComponentStore for medium apps with component-level state, and NgRx Store for large apps with complex cross-feature dependencies. The decision depends on state scope, complexity, and whether you need devtools and action tracing.

How do I migrate from BehaviorSubject to Angular Signals?

Replace BehaviorSubject with a private writable signal and expose it publicly with asReadonly(). Change calls from subject.next(value) to signal.set(value) or signal.update(), and convert derived observables to computed() signals.

What is NgRx SignalStore and when should I use it?

NgRx SignalStore is a signal-based state solution built with signalStore, withState, withComputed, and withMethods. Use it for feature-scoped state that needs computed values and methods without the boilerplate of full NgRx actions, reducers, and effects.

Can I combine RxJS observables with Angular Signals?

Yes, use toSignal() from @angular/core/rxjs-interop to convert observables like route params into signals, and toObservable() to convert signals back into observables for operators like debounceTime and switchMap.

How do I implement optimistic updates with Angular Signals?

Update the signal state immediately before the HTTP request, then roll back to the previous state in the catch block if the request fails. Store the prior data snapshot before mutating so it can be restored on error.

When should I not use NgRx Store in an Angular app?

Avoid NgRx Store for small apps or simple shared UI state like theme and preferences, where a lightweight Signal service is sufficient. NgRx adds boilerplate that only pays off with complex cross-feature state flows.