What problem does it solve?
Many Angular applications rely on Observable and BehaviorSubject patterns that create asynchronous complexity, scattered state updates, and verbose subscription management; this Skill presents signal-based patterns to simplify synchronous, fine-grained reactive state and reduce boilerplate.
Core Features & Use Cases
- Writable and Derived State: Guidance to create and manage writable signals and computed derived values to keep component and service state predictable.
- Dependent State & Reset: Patterns using linkedSignal to preserve or reset dependent selections when sources change.
- Side Effects and Lifecycle: Best practices for effect usage, cleanup, and running effects in injection contexts.
- RxJS Interop & Resources: Converting Observables to signals and signals to Observables, using resource() for async loaders, and examples for optimistic updates.
- Testing & Debugging: Strategies for writing unit tests against signals and debugging signal changes in complex stores.
Quick Start
Convert a component that uses BehaviorSubject and manual subscriptions into signal(), computed(), linkedSignal(), and effect() patterns with toSignal/toObservable interop and include a simple unit test for the resulting store.