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

This commit is contained in:
Julien Valverdé
2025-04-11 20:10:34 +02:00
parent c1b6e73231
commit 9d47418a69

View File

@@ -422,11 +422,15 @@ export abstract class ReffuseHelpers<R> {
React.Dispatch<React.SetStateAction<Effect.Effect.Success<Refs[K]>>>,
]
} {
// const initialState = this.useMemo(() => Effect.Do.pipe(
// Effect.bindAll(() => refs)
// ), [], { doNotReExecuteOnRuntimeOrContextChange: true })
const [reactStateValue, setReactStateValue] = React.useState(
this.useMemo(() => Effect.Do.pipe(
Effect.bindAll(() => refs as Record<string, SubscriptionRef.SubscriptionRef<any>>)
), [], {
doNotReExecuteOnRuntimeOrContextChange: true
}) as { readonly [K in keyof Refs]: any }
)
// const [reactStateValue, setReactStateValue] = React.useState(initialState)
this.useFork(() => )
// this.useFork(() => Stream.runForEach(
// Stream.changesWith(ref.changes, (x, y) => x === y),