mobx 6.3.7 → 6.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mobx.esm.js CHANGED
@@ -3693,9 +3693,12 @@ var ObservableArrayAdministration = /*#__PURE__*/function () {
3693
3693
 
3694
3694
  return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));
3695
3695
  } else {
3696
- var res = this.values_.slice(index, index + deleteCount);
3697
- var oldItems = this.values_.slice(index + deleteCount);
3698
- this.values_.length = index + newItems.length - deleteCount;
3696
+ // The items removed by the splice
3697
+ var res = this.values_.slice(index, index + deleteCount); // The items that that should remain at the end of the array
3698
+
3699
+ var oldItems = this.values_.slice(index + deleteCount); // New length is the previous length + addition count - deletion count
3700
+
3701
+ this.values_.length += newItems.length - deleteCount;
3699
3702
 
3700
3703
  for (var i = 0; i < newItems.length; i++) {
3701
3704
  this.values_[index + i] = newItems[i];