@ipxjs/refract 0.7.0 → 0.8.0
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
|
@@ -33,14 +33,16 @@ function cleanupFiberEffects(fiber: Fiber): void {
|
|
|
33
33
|
if (!fiber.hooks) return;
|
|
34
34
|
|
|
35
35
|
for (const hook of fiber.hooks) {
|
|
36
|
-
const state = hook.state
|
|
37
|
-
if (state
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const state = hook.state;
|
|
37
|
+
if (!state || typeof state !== "object") continue;
|
|
38
|
+
const effectState = state as { cleanup?: () => void; pending?: boolean };
|
|
39
|
+
if (effectState.cleanup) {
|
|
40
|
+
effectState.cleanup();
|
|
41
|
+
effectState.cleanup = undefined;
|
|
40
42
|
}
|
|
41
43
|
// Prevent deferred passive effects from running on unmounted fibers
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
+
if ("pending" in effectState) {
|
|
45
|
+
effectState.pending = false;
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
}
|