Angular · Signals · RxJS · Frontend

Angular Signals vs RxJS: When to Use Which

The difference between Angular signals and RxJS, which one fits which problem, and practical ways to combine them with toSignal and toObservable.

Sander Yazıcıoğlu Published: 2 min read Türkçe oku

Angular Signals vs RxJS: When to Use Which

Signals arrived in Angular 16, and many teams immediately asked "are we dropping RxJS?". The short answer is no. They solve different problems, and you get the best results by using each where it is strong. These are the rules I settled on while using both side by side in enterprise Angular apps.

What is a signal?

A signal is a box that holds a value and notifies whatever depends on it when the value changes. It always has a value and is read synchronously:

import { signal, computed, effect } from '@angular/core';

const count = signal(0);
const double = computed(() => count() * 2);

effect(() => console.log('double:', double()));
count.set(5); // double: 10

Angular knows which signals a template reads and updates only the affected component when they change. That is far more targeted than the zone.js approach of checking the whole tree after every event.

Where RxJS is still unbeatable

An Observable is a stream of events over time. It may have no value yet, emit many values, and be cancelled. Nothing replaces RxJS in these cases:

  • Async orchestration: a search box with debounceTime, distinctUntilChanged and switchMap to cancel the previous request.
  • Combining streams: combineLatest, merge, withLatestFrom.
  • WebSockets and event streams: filtering, grouping and buffering a constant flow of messages.
  • Retries and timeouts: retry, timeout, catchError.

The practical rule

  • State → signals. Selected tab, form step, filter values, the current user, a cart.
  • Events and async flows → RxJS. Chained HTTP calls, user input streams, realtime data.
  • Convert at the boundary. Turn a stream's result into a signal when you hand it to the template.
import { toSignal, toObservable } from '@angular/core/rxjs-interop';

query = signal('');
results = toSignal(
  toObservable(this.query).pipe(
    debounceTime(300),
    distinctUntilChanged(),
    switchMap((q) => this.api.search(q))
  ),
  { initialValue: [] }
);

The user's input is a signal, the search logic is an RxJS pipeline, and the result is again a signal the template reads easily. No async pipe and no manual subscribe/unsubscribe.

Common mistakes

  1. Syncing state with effect. Setting one signal inside an effect when another changes leads to loops and hard-to-read code. Use computed for derived values, or linkedSignal where needed, and keep effect for side effects such as logging or writing to localStorage.
  2. Turning everything into signals. Rewriting a complex async flow with effect and setTimeout reinvents what RxJS already solved.
  3. Using toSignal outside a component. toSignal needs an injection context; in services or outside the constructor, pass the injector option.

Migrating an existing app

You don't need to "convert" a big app to signals. The order I follow:

  1. Keep local state in signals for newly written components.
  2. Use input() instead of @Input() and output() instead of @Output().
  3. Gradually move simple BehaviorSubject-based stores in services to signals.
  4. Leave HTTP and WebSocket streams in RxJS.

I cover the upgrade itself in the Angular upgrade guide; being on a current version makes adopting signals much easier.

Conclusion

Signals simplify Angular's state and change-detection story; RxJS remains the strongest tool for async work. Keep state in signals, flows in RxJS, and meet at the boundary with toSignal and toObservable.

Angular Performance with OnPush and Change Detection

December 2, 2026 · 2 min read

Angular Performance with OnPush and Change Detection

Default versus OnPush change detection in Angular, what triggers an OnPush check, speeding up large lists with track and trackBy, and the most common mistakes.

AngularPerformanceFrontendTypeScript

All articles →