Connecting Signals and RxJS
Bridge signals and observables with interop.
Two Reactive Worlds
Angular apps mix signals (synchronous, pull-based) and RxJS Observables (asynchronous, push-based streams). The @angular/core/rxjs-interop package bridges them with toSignal and toObservable.
toSignal Basics
toSignal() subscribes to an Observable and exposes its latest value as a read-only signal. It unsubscribes automatically when the injection context is destroyed.
import { toSignal } from '@angular/core/rxjs-interop';
clock = toSignal(interval(1000), { initialValue: 0 });
// read in template: {{ clock() }}All lessons in this course
- Signal Stores in Services
- Deriving State with computed
- Updating State Immutably
- Connecting Signals and RxJS