Today, I’d like to challenge you with a small exercise. Take a minute to examine the three following code examples and decide which option performs best. Note how similar those three options are from a syntax standpoint, yet they yield very different results performance-wise:
Example #1 – Array of data
<div *ngFor="let data of getData()">{{data.name}}</div>
Example #2 – Observable
<div *ngFor="let data of getData() | async">{{data.name}}</div>
Example #3 – Signal
<div *ngFor="let data of dataSignal()">{{data.name}}</div>
Feel free to list the pros and cons of each approach. You can even respond to that email with your answers if you want. Tomorrow, I’ll give you my insights.