mobx 6.13.2 → 6.13.4

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.
@@ -711,12 +711,19 @@
711
711
  var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;
712
712
  return createAction((_ann$options_$name = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.name) != null ? _ann$options_$name : name.toString(), m, (_ann$options_$autoAct = (_ann$options_2 = ann.options_) == null ? void 0 : _ann$options_2.autoAction) != null ? _ann$options_$autoAct : false);
713
713
  };
714
- // Backwards/Legacy behavior, expects makeObservable(this)
715
714
  if (kind == "field") {
716
- addInitializer(function () {
717
- storeAnnotation(this, name, ann);
718
- });
719
- return;
715
+ return function (initMthd) {
716
+ var _ann$options_3;
717
+ var mthd = initMthd;
718
+ if (!isAction(mthd)) {
719
+ mthd = _createAction(mthd);
720
+ }
721
+ if ((_ann$options_3 = ann.options_) != null && _ann$options_3.bound) {
722
+ mthd = mthd.bind(this);
723
+ mthd.isMobxAction = true;
724
+ }
725
+ return mthd;
726
+ };
720
727
  }
721
728
  if (kind == "method") {
722
729
  var _this$options_2;
@@ -4393,7 +4400,7 @@
4393
4400
  _proto.values = function values() {
4394
4401
  var self = this;
4395
4402
  var keys = this.keys();
4396
- return makeIterable({
4403
+ return makeIterableForMap({
4397
4404
  next: function next() {
4398
4405
  var _keys$next = keys.next(),
4399
4406
  done = _keys$next.done,
@@ -4408,7 +4415,7 @@
4408
4415
  _proto.entries = function entries() {
4409
4416
  var self = this;
4410
4417
  var keys = this.keys();
4411
- return makeIterable({
4418
+ return makeIterableForMap({
4412
4419
  next: function next() {
4413
4420
  var _keys$next2 = keys.next(),
4414
4421
  done = _keys$next2.done,
@@ -4589,6 +4596,10 @@
4589
4596
  }();
4590
4597
  // eslint-disable-next-line
4591
4598
  var isObservableMap = /*#__PURE__*/createInstanceofPredicate("ObservableMap", ObservableMap);
4599
+ function makeIterableForMap(iterator) {
4600
+ iterator[Symbol.toStringTag] = "MapIterator";
4601
+ return makeIterable(iterator);
4602
+ }
4592
4603
  function convertToMap(dataStructure) {
4593
4604
  if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {
4594
4605
  return dataStructure;
@@ -4749,7 +4760,7 @@
4749
4760
  var nextIndex = 0;
4750
4761
  var keys = Array.from(this.keys());
4751
4762
  var values = Array.from(this.values());
4752
- return makeIterable({
4763
+ return makeIterableForSet({
4753
4764
  next: function next() {
4754
4765
  var index = nextIndex;
4755
4766
  nextIndex += 1;
@@ -4757,6 +4768,7 @@
4757
4768
  value: [keys[index], values[index]],
4758
4769
  done: false
4759
4770
  } : {
4771
+ value: undefined,
4760
4772
  done: true
4761
4773
  };
4762
4774
  }
@@ -4770,12 +4782,13 @@
4770
4782
  var self = this;
4771
4783
  var nextIndex = 0;
4772
4784
  var observableValues = Array.from(this.data_.values());
4773
- return makeIterable({
4785
+ return makeIterableForSet({
4774
4786
  next: function next() {
4775
4787
  return nextIndex < observableValues.length ? {
4776
4788
  value: self.dehanceValue_(observableValues[nextIndex++]),
4777
4789
  done: false
4778
4790
  } : {
4791
+ value: undefined,
4779
4792
  done: true
4780
4793
  };
4781
4794
  }
@@ -4878,6 +4891,10 @@
4878
4891
  }();
4879
4892
  // eslint-disable-next-line
4880
4893
  var isObservableSet = /*#__PURE__*/createInstanceofPredicate("ObservableSet", ObservableSet);
4894
+ function makeIterableForSet(iterator) {
4895
+ iterator[Symbol.toStringTag] = "SetIterator";
4896
+ return makeIterable(iterator);
4897
+ }
4881
4898
 
4882
4899
  var descriptorCache = /*#__PURE__*/Object.create(null);
4883
4900
  var REMOVE = "remove";
@@ -5867,11 +5884,7 @@
5867
5884
  }
5868
5885
 
5869
5886
  function makeIterable(iterator) {
5870
- iterator[Symbol.iterator] = getSelf;
5871
- return iterator;
5872
- }
5873
- function getSelf() {
5874
- return this;
5887
+ return Object.assign(Object.create(Iterator.prototype), iterator);
5875
5888
  }
5876
5889
 
5877
5890
  function isAnnotation(thing) {