@slimlib/store 2.2.4 → 2.2.6
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/index.mjs +5 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -681,6 +681,8 @@ const effect = (callback, eager = 0 ) => {
|
|
|
681
681
|
const dispose = () => {
|
|
682
682
|
|
|
683
683
|
if (!disposed) {
|
|
684
|
+
if (effects)
|
|
685
|
+
effects[effectIndex] = undefined;
|
|
684
686
|
|
|
685
687
|
disposed = true;
|
|
686
688
|
|
|
@@ -692,10 +694,8 @@ const effect = (callback, eager = 0 ) => {
|
|
|
692
694
|
clearSources(node);
|
|
693
695
|
}
|
|
694
696
|
};
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
effectScope[trackSymbol](dispose);
|
|
698
|
-
}
|
|
697
|
+
const effects = effectScope?.[trackSymbol];
|
|
698
|
+
const effectIndex = effects ? effects.push(dispose) - 1 : -1;
|
|
699
699
|
|
|
700
700
|
|
|
701
701
|
|
|
@@ -777,7 +777,7 @@ const scope = (callback, parent = activeScope) => {
|
|
|
777
777
|
return ctx;
|
|
778
778
|
});
|
|
779
779
|
|
|
780
|
-
ctx[trackSymbol] =
|
|
780
|
+
ctx[trackSymbol] = effects;
|
|
781
781
|
ctx[childrenSymbol] = children;
|
|
782
782
|
ctx[parentSymbol] = parent;
|
|
783
783
|
|