mobx 6.13.3 → 6.13.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # mobx
2
2
 
3
+ ## 6.13.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4c077738776d5fc7ba0f108805a9ec816c2709b9`](https://github.com/mobxjs/mobx/commit/4c077738776d5fc7ba0f108805a9ec816c2709b9) [#3943](https://github.com/mobxjs/mobx/pull/3943) Thanks [@tonyraoul](https://github.com/tonyraoul)! - Fix browser compatability issue introduced in 6.13.4 release
8
+
9
+ ## 6.13.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [`f91d2e1dc85a53b729c03bd28ab39ffcf0838403`](https://github.com/mobxjs/mobx/commit/f91d2e1dc85a53b729c03bd28ab39ffcf0838403) [#3935](https://github.com/mobxjs/mobx/pull/3935) Thanks [@tonyraoul](https://github.com/tonyraoul)! - Update typescript version to 5.6.2 and added support for esnext iterator helpers
14
+
3
15
  ## 6.13.3
4
16
 
5
17
  ### Patch Changes
@@ -42,7 +42,7 @@ export declare class Reaction implements IDerivation, IReactionPublic {
42
42
  private static readonly diffValueMask_;
43
43
  private flags_;
44
44
  isTracing_: TraceMode;
45
- constructor(name_: string, onInvalidate_: () => void, errorHandler_?: ((error: any, derivation: IDerivation) => void) | undefined, requiresObservable_?: any);
45
+ constructor(name_: string | undefined, onInvalidate_: () => void, errorHandler_?: ((error: any, derivation: IDerivation) => void) | undefined, requiresObservable_?: any);
46
46
  get isDisposed(): boolean;
47
47
  set isDisposed(newValue: boolean);
48
48
  get isScheduled(): boolean;
@@ -4398,7 +4398,7 @@ var ObservableMap = /*#__PURE__*/function () {
4398
4398
  _proto.values = function values() {
4399
4399
  var self = this;
4400
4400
  var keys = this.keys();
4401
- return makeIterable({
4401
+ return makeIterableForMap({
4402
4402
  next: function next() {
4403
4403
  var _keys$next = keys.next(),
4404
4404
  done = _keys$next.done,
@@ -4413,7 +4413,7 @@ var ObservableMap = /*#__PURE__*/function () {
4413
4413
  _proto.entries = function entries() {
4414
4414
  var self = this;
4415
4415
  var keys = this.keys();
4416
- return makeIterable({
4416
+ return makeIterableForMap({
4417
4417
  next: function next() {
4418
4418
  var _keys$next2 = keys.next(),
4419
4419
  done = _keys$next2.done,
@@ -4594,6 +4594,10 @@ var ObservableMap = /*#__PURE__*/function () {
4594
4594
  }();
4595
4595
  // eslint-disable-next-line
4596
4596
  var isObservableMap = /*#__PURE__*/createInstanceofPredicate("ObservableMap", ObservableMap);
4597
+ function makeIterableForMap(iterator) {
4598
+ iterator[Symbol.toStringTag] = "MapIterator";
4599
+ return makeIterable(iterator);
4600
+ }
4597
4601
  function convertToMap(dataStructure) {
4598
4602
  if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {
4599
4603
  return dataStructure;
@@ -4754,7 +4758,7 @@ var ObservableSet = /*#__PURE__*/function () {
4754
4758
  var nextIndex = 0;
4755
4759
  var keys = Array.from(this.keys());
4756
4760
  var values = Array.from(this.values());
4757
- return makeIterable({
4761
+ return makeIterableForSet({
4758
4762
  next: function next() {
4759
4763
  var index = nextIndex;
4760
4764
  nextIndex += 1;
@@ -4762,6 +4766,7 @@ var ObservableSet = /*#__PURE__*/function () {
4762
4766
  value: [keys[index], values[index]],
4763
4767
  done: false
4764
4768
  } : {
4769
+ value: undefined,
4765
4770
  done: true
4766
4771
  };
4767
4772
  }
@@ -4775,12 +4780,13 @@ var ObservableSet = /*#__PURE__*/function () {
4775
4780
  var self = this;
4776
4781
  var nextIndex = 0;
4777
4782
  var observableValues = Array.from(this.data_.values());
4778
- return makeIterable({
4783
+ return makeIterableForSet({
4779
4784
  next: function next() {
4780
4785
  return nextIndex < observableValues.length ? {
4781
4786
  value: self.dehanceValue_(observableValues[nextIndex++]),
4782
4787
  done: false
4783
4788
  } : {
4789
+ value: undefined,
4784
4790
  done: true
4785
4791
  };
4786
4792
  }
@@ -4883,6 +4889,10 @@ var ObservableSet = /*#__PURE__*/function () {
4883
4889
  }();
4884
4890
  // eslint-disable-next-line
4885
4891
  var isObservableSet = /*#__PURE__*/createInstanceofPredicate("ObservableSet", ObservableSet);
4892
+ function makeIterableForSet(iterator) {
4893
+ iterator[Symbol.toStringTag] = "SetIterator";
4894
+ return makeIterable(iterator);
4895
+ }
4886
4896
 
4887
4897
  var descriptorCache = /*#__PURE__*/Object.create(null);
4888
4898
  var REMOVE = "remove";
@@ -5871,9 +5881,12 @@ function unwrap(a) {
5871
5881
  return a;
5872
5882
  }
5873
5883
 
5884
+ var _getGlobal$Iterator;
5885
+ // safely get iterator prototype if available
5886
+ var maybeIteratorPrototype = ((_getGlobal$Iterator = /*#__PURE__*/getGlobal().Iterator) == null ? void 0 : _getGlobal$Iterator.prototype) || {};
5874
5887
  function makeIterable(iterator) {
5875
5888
  iterator[Symbol.iterator] = getSelf;
5876
- return iterator;
5889
+ return Object.assign(Object.create(maybeIteratorPrototype), iterator);
5877
5890
  }
5878
5891
  function getSelf() {
5879
5892
  return this;