6 Signals: a new approach to reactive programming
This chapter covers
- Learning about issues developers face when working with RxJS in Angular
- Introducing signals, Angular’s new reactive primitive
- Creating new signals and side-effects from existing ones
- Learning about signals interoperability with RxJS
In the previous chapter we talked about reactive programming, how it is useful when working with front-end applications, and how Angular’s commonly chosen library to work with reactivity is RxJS. We covered new approaches and tools Angular provides for working with RxJS, but we did not cover the issues that RxJS itself has, and which cannot be mitigated simply by adding new tools into the arsenal of Angular developers. In this chapter, let’s focus on these new changes, and discuss signals: a new reactive primitive introduced by the Angular core team into the framework itself, which allows to read values, subscribe to them, derive new values, and execute side effects without having to deal with RxJS at all. Let us see why this new primitive will be helpful and allow us to mitigate various issues with reactivity.