Working SubscribeRefs
All checks were successful
Lint / lint (push) Successful in 14s

This commit is contained in:
Julien Valverdé
2025-04-12 00:16:04 +02:00
parent cbd39f893e
commit 5f5ef5614b
2 changed files with 18 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ export abstract class ReffuseHelpers<R> {
declare ["constructor"]: ReffuseHelpersClass<R>
constructor() {
this.SubscribeRefs = this.SubscribeRefs.bind(this as any) as any
this.RefState = this.RefState.bind(this as any) as any
}
@@ -448,6 +449,19 @@ export abstract class ReffuseHelpers<R> {
}
SubscribeRefs<
const Refs extends readonly SubscriptionRef.SubscriptionRef<any>[],
R,
>(
this: ReffuseHelpers<R>,
props: {
readonly refs: Refs
readonly children: (...args: [...{ [K in keyof Refs]: Effect.Effect.Success<Refs[K]> }]) => React.ReactNode
},
): React.ReactNode {
return props.children(...this.useSubscribeRefs(...props.refs))
}
RefState<A, R>(
this: ReffuseHelpers<R>,
props: {