From aeeb2bddf95f53b41ce632a29194620d2bb0961b Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Wed, 22 May 2024 16:58:32 -0400 Subject: [PATCH] improve effects example slightly (#13) Just adds a line to release anything that might be held in a closure by the cleanup function. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c14e296..ff8f908 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,7 @@ export function effect(callback) { return () => { w.unwatch(computed); typeof cleanup === "function" && cleanup(); + cleanup = undefined; }; } ```