Frontmatter
| id | 3116 |
| title | vdom.Helper: createDeltas() => enhance the logic for re-sorting arrays |
| state | Closed |
| labels | enhancement |
| assignees | tobiu |
| createdAt | May 30, 2022, 10:13 PM |
| updatedAt | May 30, 2022, 10:16 PM |
| githubUrl | https://github.com/neomjs/neo/issues/3116 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | May 30, 2022, 10:16 PM |
This item is tricky, since there are many edge cases to be aware of.
In case we re-sort an array and some items stay at the "same" index, the vdom engine does not think that there is a need for a change. However, in case we add or remove items in front of an array item which should stay at the same index, it can interfere with items which get moved as well, leading to a broken order.
We want to achieve:
vdom.cn.unshift(vdom.cn.pop());should only create one delta.I think we can do this with just one line of magic :)