angular-signals

Implement reactive state management in Angular using signal, computed, linkedSignal, and effect APIs.

Updated Jun 28, 2026
One-click install
npx skills add https://github.com/412181-HerediaLara/ScaffoldingBE-FE --skill angular-signals-412181-heredialara
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-signals
Source: https://github.com/412181-HerediaLara/ScaffoldingBE-FE/tree/main/FE/.agents/skills/angular-signals
Command: npx skills add https://github.com/412181-HerediaLara/ScaffoldingBE-FE --skill angular-signals-412181-heredialara

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing reactive state in Angular applications often involves verbose RxJS subscriptions, manual cleanup, and change detection complexity. This Skill provides patterns for implementing fine-grained, synchronous reactivity with Angular Signals, reducing boilerplate and simplifying state flows. ## Core Features & Use Cases - Core Signal APIs: Create writable state with signal(), derived state with computed(), resettable dependent state with linkedSignal(), and side effects with effect(). - RxJS Interoperability: Convert Observables to signals with toSignal() and signals back to Observables with toObservable() for gradual migration from BehaviorSubject patterns. - Advanced Patterns: Reference material covers the resource() API for async data fetching, signal stores, form state, optimistic updates, and testing strategies. - Use Case: When building a todo list component, use signal() for the items array, computed() for filtered views and remaining counts, and update methods for immutable state transitions—no subscriptions or ngOnDestroy cleanup required. ## Quick Start Ask the AI to refactor an Angular component's BehaviorSubject-based state into signals using signal(), computed(), and effect().

Frequently Asked Questions about angular-signals

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

FAQPage Schema
How do I create reactive state in Angular with signals?

Use signal() to create writable state, then read it by calling it as a function. Update values with set() for replacements or update() for transformations based on the current value. Derived values use computed(), which automatically recalculates when dependencies change.

How to convert RxJS Observables to Angular signals?

Use toSignal() from @angular/core/rxjs-interop to convert an Observable into a signal. Provide an initialValue option or use requireSync for synchronous Observables like BehaviorSubject. Use toObservable() for the reverse direction when you need RxJS operators.

What is the difference between computed and linkedSignal in Angular?

computed() creates read-only derived state that recalculates when dependencies change. linkedSignal() creates writable dependent state that automatically resets when its source changes, useful for selections that should default when an options list updates.

Does Angular signals work with async HTTP data fetching?

Yes, the resource() API handles async fetching with signals by accepting params and a loader function. It exposes value, isLoading, error, and status signals, supports default values, conditional loading, and manual reloads.

When should I use signals instead of BehaviorSubject in Angular?

Signals fit synchronous, fine-grained reactivity like component state and derived values without subscription management. Keep RxJS for event streams requiring operators like debounceTime or switchMap, bridging both worlds with toSignal and toObservable.

Why is my Angular effect not running or cleaning up?

Effects must run inside an injection context, typically the component constructor or via runInInjectionContext. They clean up automatically when the owning component is destroyed, and you can register additional cleanup logic with the onCleanup callback.