Angular Signals

A new reactive primitive

Valerio Como
tech bits pub

--

Photo by Carlos Alberto Gómez Iñiguez on Unsplash

Signals is a new primitive, which aims to handle asynchronous events and supports developers in adoptions of reactive patterns. It will be released with Angular 16 but it’s yet available through an unstable version of the package (16.0.0-next.0).

You may be wondering:

“is RxJs deprecated?”

The answer is simple: no.

Signals provide a straightforward approach to solve a similar problem. Take a look at this simple example.

In this example, we have two variables: number and squared.

I set number to 1 with the primitive signal. Then, squared is assigned with compute and a callback as parameter. Every time number is updated, squared will be updated too. Simply as hell. No more RxJS to handle those kind of async events. It’s a blurry memory but it recalls signals and slots pattern of Qt.

As general statement, signals implements a producer/consumer pattern.

Why Signals?

The introduction of signals it’s the first step of a long-time change in Angular. ChangeDetection

--

--

Valerio Como
tech bits pub

Technical Project Manager @ Dipartimento Trasformazione Digitale | Team Leader | Angular enthusiast | https://www.valeriocomo.com