useRefFromValue
All checks were successful
Lint / lint (push) Successful in 13s

This commit is contained in:
Julien Valverdé
2025-04-30 13:33:21 +02:00
parent ff5503cfd1
commit da7044ee9f

View File

@@ -389,6 +389,15 @@ export abstract class ReffuseNamespace<R> {
)
}
useRefFromValue<A, R>(
this: ReffuseNamespace<R>,
value: A,
): SubscriptionRef.SubscriptionRef<A> {
const ref = this.useRef(value)
this.useEffect(() => Ref.set(ref, value), [value])
return ref
}
useSubRef<B, const P extends PropertyPath.Paths<B>, R>(
this: ReffuseNamespace<R>,
parent: SubscriptionRef.SubscriptionRef<B>,