7 Signals: A deep dive

 

This chapter covers

  • Signal value equality and advanced manual cleanup of effects
  • The internal workings of signals
  • State management across components using signals
  • Caveats of using signals with RxJS
  • Migrating to signals
  • The future of signals

In the previous chapter, we learned about the basics of working with signals: how to create them, change their value, derive new signals from existing ones, and make them work with RxJS observables. Now, as advertised in the title of this chapter, we will take a deep dive into the world of signals and learn about advanced options, best practices, and ways to migrate existing applications to use signals. Let’s get started!

7.1 Advanced options when dealing with signals

So far, we have learned that signals are wrappers around values, which also notify us about the changes to those values. The process is pretty straightforward, accomplished via either the computed or effect functions. However, the default logic behind those computations is sometimes not enough to describe some complex processes and requires modification. Let’s learn about those options and when we might want to use them.

7.1.1 Signal equality

7.1.2 Untracking dependencies

7.1.3 Manual cleanup

7.1.4 Readonly signals and synchronizing with RxJS

7.2 Signals under the hood

7.2.1 The nature of signals

7.2.2 How changes to signals propagate

7.3 State management with signals

7.3.1 State management: The task

7.3.2 State management: The implementation

7.3.3 State management: The problems

7.3.4 Advanced interoperability with RxJS

7.4 Migrating to signals

7.4.1 Migrating RxJS-heavy Angular applications

7.4.2 Migrating more traditional Angular applications

7.5 The future of signals

7.5.1 Signal-based components

7.5.2 Signal inputs and outputs