native-document 1.0.252 → 1.0.253

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-document",
3
- "version": "1.0.252",
3
+ "version": "1.0.253",
4
4
  "description": "A reactive JavaScript framework that preserves native DOM simplicity without sacrificing modern features",
5
5
  "author": "AfroCodeur <https://github.com/afrocodeur>",
6
6
  "license": "MIT",
@@ -525,19 +525,23 @@ ObservableArray.prototype.isNotEmpty = function () {
525
525
  };
526
526
 
527
527
  ObservableArray.prototype.fnPush = function (item) {
528
- return this.push(item);
528
+ const self = this;
529
+ return () => self.push(item);
529
530
  };
530
531
 
531
532
  ObservableArray.prototype.fnRemove = function (item) {
532
- return () => this.removeItem(item);
533
+ const self = this;
534
+ return () => self.removeItem(item);
533
535
  };
534
536
 
535
537
  ObservableArray.prototype.fnRemoveAt = function (index) {
536
- return () => this.remove(index);
538
+ const self = this;
539
+ return () => self.remove(index);
537
540
  };
538
541
 
539
542
  ObservableArray.prototype.fnClear = function () {
540
- return () => this.clear();
543
+ const self = this;
544
+ return () => self.clear();
541
545
  };
542
546
 
543
547
  ObservableArray.prototype.rawValue = function () {
@@ -734,21 +734,26 @@ ObservableItem.prototype.watch = function(fn, autoCall = true) {
734
734
 
735
735
 
736
736
  ObservableItem.prototype.fnSet = function(value) {
737
- return () => this.set(value);
737
+ const self = this;
738
+ return () => self.set(value);
738
739
  };
739
740
 
740
741
  ObservableItem.prototype.fnToggle = function() {
741
- return () => this.toggle();
742
+ const self = this;
743
+ return () => self.toggle();
742
744
  };
743
745
 
744
746
  ObservableItem.prototype.fnSetTrue = function() {
745
- return () => this.set(true);
747
+ const self = this;
748
+ return () => self.set(true);
746
749
  };
747
750
 
748
751
  ObservableItem.prototype.fnSetFalse = function() {
749
- return () => this.set(false);
752
+ const self = this;
753
+ return () => self.set(false);
750
754
  };
751
755
 
752
756
  ObservableItem.prototype.fnReset = function() {
753
- return () => this.reset();
757
+ const self = this;
758
+ return () => self.reset();
754
759
  };
@@ -271,7 +271,8 @@ export const StoreFactory = function() {
271
271
  */
272
272
  follow(name) {
273
273
  const { observer: originalObserver, subscribers } = $getStoreOrThrow('follow', name);
274
- const observerFollower = $createObservable(originalObserver.val());
274
+ const value = originalObserver.val();
275
+ const observerFollower = $createObservable(Array.isArray(value) ? [...value] : value);
275
276
 
276
277
  const onStoreChange = $synchroProtectedFollower(originalObserver, observerFollower, name,'follow');
277
278