Skip to content

Commit aeeb2bd

Browse files
authored
improve effects example slightly (#13)
Just adds a line to release anything that might be held in a closure by the cleanup function.
1 parent 30211ee commit aeeb2bd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export function effect(callback) {
8686
return () => {
8787
w.unwatch(computed);
8888
typeof cleanup === "function" && cleanup();
89+
cleanup = undefined;
8990
};
9091
}
9192
```

0 commit comments

Comments
 (0)