@solidjs/signals 0.4.0 → 0.4.1
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/dev.js +12 -9
- package/dist/node.cjs +149 -146
- package/dist/prod.js +149 -146
- package/dist/types/core/effect.d.ts +3 -1
- package/package.json +1 -1
package/dist/dev.js
CHANGED
|
@@ -678,7 +678,7 @@ var Effect = class extends Computation {
|
|
|
678
678
|
this._compute = (p) => getClock() > this._queue.created && !(this._stateFlags & ERROR_BIT) ? latest(() => compute2(p)) : compute2(p);
|
|
679
679
|
}
|
|
680
680
|
this._updateIfNecessary();
|
|
681
|
-
!options?.defer && (this._type === EFFECT_USER ? this._queue.enqueue(this._type, this.
|
|
681
|
+
!options?.defer && (this._type === EFFECT_USER ? this._queue.enqueue(this._type, this._run.bind(this)) : this._run(this._type));
|
|
682
682
|
if (!this._parent)
|
|
683
683
|
console.warn("Effects created outside a reactive context will never be disposed");
|
|
684
684
|
}
|
|
@@ -700,7 +700,7 @@ var Effect = class extends Computation {
|
|
|
700
700
|
if (this._state >= state || skipQueue)
|
|
701
701
|
return;
|
|
702
702
|
if (this._state === STATE_CLEAN)
|
|
703
|
-
this._queue.enqueue(this._type, this.
|
|
703
|
+
this._queue.enqueue(this._type, this._run.bind(this));
|
|
704
704
|
this._state = state;
|
|
705
705
|
}
|
|
706
706
|
_setError(error) {
|
|
@@ -730,7 +730,7 @@ var Effect = class extends Computation {
|
|
|
730
730
|
this._cleanup = void 0;
|
|
731
731
|
super._disposeNode();
|
|
732
732
|
}
|
|
733
|
-
|
|
733
|
+
_run(type) {
|
|
734
734
|
if (type) {
|
|
735
735
|
if (this._modified && this._state !== STATE_DISPOSED) {
|
|
736
736
|
this._cleanup?.();
|
|
@@ -748,9 +748,6 @@ var Effect = class extends Computation {
|
|
|
748
748
|
this._state !== STATE_CLEAN && runTop(this);
|
|
749
749
|
}
|
|
750
750
|
};
|
|
751
|
-
function runComputation() {
|
|
752
|
-
this._state !== STATE_CLEAN && runTop(this);
|
|
753
|
-
}
|
|
754
751
|
var EagerComputation = class extends Computation {
|
|
755
752
|
constructor(initialValue, compute2, options) {
|
|
756
753
|
super(initialValue, compute2, options);
|
|
@@ -762,9 +759,12 @@ var EagerComputation = class extends Computation {
|
|
|
762
759
|
if (this._state >= state && !this._forceNotify)
|
|
763
760
|
return;
|
|
764
761
|
if (!skipQueue && (this._state === STATE_CLEAN || this._state === STATE_CHECK && this._forceNotify))
|
|
765
|
-
this._queue.enqueue(EFFECT_PURE,
|
|
762
|
+
this._queue.enqueue(EFFECT_PURE, this._run.bind(this));
|
|
766
763
|
super._notify(state, skipQueue);
|
|
767
764
|
}
|
|
765
|
+
_run() {
|
|
766
|
+
this._state !== STATE_CLEAN && runTop(this);
|
|
767
|
+
}
|
|
768
768
|
};
|
|
769
769
|
var FirewallComputation = class extends Computation {
|
|
770
770
|
firewall = true;
|
|
@@ -777,10 +777,13 @@ var FirewallComputation = class extends Computation {
|
|
|
777
777
|
if (this._state >= state && !this._forceNotify)
|
|
778
778
|
return;
|
|
779
779
|
if (!skipQueue && (this._state === STATE_CLEAN || this._state === STATE_CHECK && this._forceNotify))
|
|
780
|
-
this._queue.enqueue(EFFECT_PURE,
|
|
780
|
+
this._queue.enqueue(EFFECT_PURE, this._run.bind(this));
|
|
781
781
|
super._notify(state, true);
|
|
782
782
|
this._forceNotify = !!skipQueue;
|
|
783
783
|
}
|
|
784
|
+
_run() {
|
|
785
|
+
this._state !== STATE_CLEAN && runTop(this);
|
|
786
|
+
}
|
|
784
787
|
};
|
|
785
788
|
function runTop(node) {
|
|
786
789
|
const ancestors = [];
|
|
@@ -1919,7 +1922,7 @@ function createErrorBoundary(fn, fallback) {
|
|
|
1919
1922
|
incrementClock();
|
|
1920
1923
|
for (let node of queue._nodes) {
|
|
1921
1924
|
node._state = STATE_DIRTY;
|
|
1922
|
-
node._queue?.enqueue(node._type, node);
|
|
1925
|
+
node._queue?.enqueue(node._type, node._run.bind(node));
|
|
1923
1926
|
}
|
|
1924
1927
|
})
|
|
1925
1928
|
);
|