Skip to the page

Angular signals · Trade-off

Signals or RxJS: when to use which

The interviewer asks

Angular already had RxJS. Why did it add signals? In a new feature, how do you decide what goes in a signal and what stays an Observable?

Then

Follow-ups the interviewer asks next

  1. What problems of RxJS in templates do signals solve?
  2. What can't signals do well?
  3. Show toSignal and toObservable. What are their gotchas?
  4. A search box: signals, RxJS, or both?
  5. Would you rewrite working RxJS code to signals? When?

The answer

What a strong answer covers

  • Signals: synchronous, always have a current value, update templates precisely, no subscribe or unsubscribe, glitch-free derived state. They drive zoneless change detection. Best for component and UI state.
  • RxJS: streams of events over time, with cancellation, time operators (debounce, throttle, retry with backoff), combining async sources, WebSockets. Signals have no idea of time or of separate events.
  • Bridges: toSignal(obs$, { initialValue }) subscribes in an injection context and unsubscribes on destroy; errors are thrown when the signal is read. toObservable(sig) emits asynchronously, so it can skip in-between values.
  • Usual split: streams and HTTP in RxJS or resources, state and template reads in signals. Search box: the query as a signal, toObservable, debounceTime and switchMap, back with toSignal; or debounced() (experimental in v22) with httpResource.
  • Don't rewrite working streams for fashion; migrate code when you touch it.

The red pen

Common traps

Avoid:"signals replace RxJS"; "RxJS is deprecated"; calling toSignal inside a method (NG0203) or on every render.

Practise this out loud

Say your answer out loud to an AI interviewer that follows up, and get a score for it.

Practise by voice

Practise questions like this out loud

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview