Fix a bug in sixtyfps.ArrayModel.remove

Report the correct index/size to the runtime.

Also added convenience entries()/values() functions that forward to the array.
This commit is contained in:
Simon Hausmann 2020-10-21 13:48:13 +02:00
parent b6655d0049
commit c59b1e61ac

View file

@ -204,7 +204,15 @@ class ArrayModel<T> implements Model<T> {
*/
remove(index: number, size: number) {
let r = this.a.splice(index, size);
this.notify.rowRemoved(size, arguments.length);
this.notify.rowRemoved(index, size);
}
values(): IterableIterator<T> {
return this.a.values();
}
entries(): IterableIterator<[number, T]> {
return this.a.entries()
}
}