Tests
All checks were successful
Lint / lint (push) Successful in 10s

This commit is contained in:
Julien Valverdé
2025-01-19 00:33:42 +01:00
parent bca9b6d0d4
commit 1ec3e616bb

View File

@@ -57,6 +57,8 @@ export class Reffuse<R> {
/** /**
* ⚠️ Scope closing on cleanup is currently broken when using React strict mode! ⚠️
*
* Reffuse equivalent to `React.useMemo`. * Reffuse equivalent to `React.useMemo`.
* *
* `useMemo` will only recompute the memoized value by running the given synchronous effect when one of the deps has changed. \ * `useMemo` will only recompute the memoized value by running the given synchronous effect when one of the deps has changed. \
@@ -87,7 +89,7 @@ export class Reffuse<R> {
React.useEffect(() => { React.useEffect(() => {
console.log("effect", value, scope) console.log("effect", value, scope)
// return () => { console.log("cleanup", value, scope); runSync(Scope.close(scope, Exit.void)) } return () => { console.log("cleanup", value, scope); runSync(Scope.close(scope, Exit.void)) }
}, [scope]) }, [scope])
return value return value