Matt-Esch/virtual-dom

An diff algorithm confusion

chs97 opened this issue · 0 comments

chs97 commented

https://github.com/Matt-Esch/virtual-dom/blob/master/vtree/diff.js line 222

let a = [ {key: 1}, {key: 2}, {key:3} ]
let b = [ {key: 3}, {key: 2}, {key:1}, {key: 5} ]
reorder(a, b)
the result is
insert 2 items and remove 2items I think it should remove 2 items and insert 3items
Is the data legal?