0.1.1 #3

Merged
Thilawyn merged 24 commits from next into master 2025-01-22 03:42:22 +01:00
Showing only changes of commit 1ec3e616bb - Show all commits

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