Angular · Senior · Question 9 of 75

When would you pass a custom equal function to a signal?

user = signal<User>(initial, { equal: (a, b) => a.id === b.id && a.version === b.version });

Explanation

By default signals use Object.is, so every new object triggers updates. A custom equality avoids recomputation and re-rendering when a refetch returns the same data.

Further reading

Problem with a question

Angular · Senior · question 9

Test yourself

Take the Angular · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz