Join GitHub today
Loop item identity vs. compare by reference #2418
If I gather correctly, this is the line where 'comparison by reference' happens:
I'm seeing lists being fully recreated whenever I cannot ensure these references are maintained, even if the underlying data has not changed. My state library (Baobab) does not preserve references by default, when an array changes. This causes unnecessary redrawing, which is slow and ugly.
In 99% of these cases, a unique identifier is already present and I would like to take advantage of this, similar to VueJS's 'key' attribute: https://vuejs.org/v2/guide/list.html#key
Is this something to consider as a new Riot attribute, or to make configurable using a callback function perhaps? The