Does it matter to Angular if in every digest cycle I return a new list with the same contents vs returning the same list instance? This is assuming default change detection, not OnPush.
It will have some impact - ngFor will need to reevaluate each of the elements - it will do identity check. That should be quick, but if you have thousands elements in a big app it may add some overhead, so if you can it's better to return the same list each time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With