useEffect
Some checks failed
Lint / lint (push) Failing after 10s

This commit is contained in:
Julien Valverdé
2025-01-15 22:12:33 +01:00
parent 14e028e8c8
commit 010416f0b1

View File

@@ -68,18 +68,18 @@ export class Reffuse<R> {
])
}
// useEffect<A, E>(
// effect: Effect.Effect<A, E, RuntimeR | ContextR | Scope.Scope>,
// deps?: React.DependencyList,
// options?: RenderOptions,
// ): void {
// const runSync = this.useRunSync()
useEffect<A, E>(
effect: Effect.Effect<A, E, R | Scope.Scope>,
deps?: React.DependencyList,
options?: RenderOptions,
): void {
const runSync = this.useRunSync()
// return React.useEffect(() => { runSync(effect) }, [
// ...options?.doNotReExecuteOnRuntimeOrContextChange ? [] : [runSync],
// ...(deps ?? []),
// ])
// }
return React.useEffect(() => { runSync(Effect.scoped(effect)) }, [
...options?.doNotReExecuteOnRuntimeOrContextChange ? [] : [runSync],
...(deps ?? []),
])
}
useSuspense<A, E>(
effect: Effect.Effect<A, E, R>,