@slimlib/store 2.2.2 → 2.2.3
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/README.md +2 -0
- package/index.mjs +8 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,8 @@ It also works really well with imperative code because the state primitive is Pr
|
|
|
17
17
|
|
|
18
18
|
[Changelog](./CHANGELOG.md)
|
|
19
19
|
|
|
20
|
+
[Known effect GC and lifetime limitation](./TECH-DEBT.md#effect-garbage-collection-and-the-documented-lifetime-contract)
|
|
21
|
+
|
|
20
22
|
## Installation
|
|
21
23
|
|
|
22
24
|
```bash
|
package/index.mjs
CHANGED
|
@@ -633,14 +633,17 @@ const effect = (callback, eager = 0 ) => {
|
|
|
633
633
|
const effectId = node.f;
|
|
634
634
|
const dispose = () => {
|
|
635
635
|
|
|
636
|
-
disposed
|
|
636
|
+
if (!disposed) {
|
|
637
637
|
|
|
638
|
-
|
|
638
|
+
disposed = true;
|
|
639
|
+
|
|
640
|
+
unregisterEffect(gcToken);
|
|
639
641
|
|
|
640
|
-
|
|
641
|
-
|
|
642
|
+
if (typeof node.l === 'function') {
|
|
643
|
+
node.l();
|
|
644
|
+
}
|
|
645
|
+
clearSources(node);
|
|
642
646
|
}
|
|
643
|
-
clearSources(node);
|
|
644
647
|
};
|
|
645
648
|
|
|
646
649
|
if (effectScope) {
|