Create new entries when shifting

This commit is contained in:
Daniel Imms
2017-05-19 19:11:28 -07:00
parent fee912023f
commit fe11837a61
+4 -1
View File
@@ -197,7 +197,10 @@ export class CircularList<T> extends EventEmitter {
if (offset > 0) {
for (let i = count - 1; i >= 0; i--) {
this._setEntry(start + i + offset, this.getEntry(start + i));
this._setEntry(start + i + offset, {
id: this._nextId++,
value: this.get(start + i)
});
}
const expandListBy = (start + count + offset) - this._length;
if (expandListBy > 0) {