Muhammed Senussi
Muhammed Senussi
  • Muhammed Senussi
Signals Did Not Replace RxJS, They Replaced Zone.js
Angular

The framing of signals versus RxJS produced a lot of heat and very little clarity. They answer different questions.

What actually changed

Before signals, Angular knew that something might have changed because Zone.js patched every asynchronous API in the browser and told it to check. That works and it is enormously wasteful: a timer firing in an unrelated corner of the application caused the whole component tree to be checked.

A signal knows precisely which computations depend on it. Change detection becomes targeted rather than swept, which is why zoneless mode is possible at all, and why it removes a chunk of JavaScript from every bundle.

How I split them now

  • Signals for state a template reads: the current filter, the selected item, derived counts.
  • RxJS for things that happen: HTTP, websockets, debounced input, anything where cancellation or ordering matters.
  • toSignal at the boundary, once, rather than converting back and forth through a component.

2 Comments

  • Daan Visser

    January 16, 2024

    Signals replaced Zone.js, not RxJS. That reframing would have saved our team a very long meeting.

    • Muhammed Senussi

      Muhammed Senussi

      AuthorJanuary 16, 2024

      It also explains why the migration guidance never says "remove your observables". The HTTP client still returns one, and that is correct — a request is an event with a lifetime, not a value you read.

Leave a comment