0.1.13 #18
@@ -23,6 +23,7 @@ export abstract class ReffuseNamespace<R> {
|
|||||||
declare ["constructor"]: ReffuseNamespaceClass<R>
|
declare ["constructor"]: ReffuseNamespaceClass<R>
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
this.SubRef = this.SubRef.bind(this as any) as any
|
||||||
this.SubscribeRefs = this.SubscribeRefs.bind(this as any) as any
|
this.SubscribeRefs = this.SubscribeRefs.bind(this as any) as any
|
||||||
this.RefState = this.RefState.bind(this as any) as any
|
this.RefState = this.RefState.bind(this as any) as any
|
||||||
this.SubscribeStream = this.SubscribeStream.bind(this as any) as any
|
this.SubscribeStream = this.SubscribeStream.bind(this as any) as any
|
||||||
@@ -483,6 +484,17 @@ export abstract class ReffuseNamespace<R> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SubRef<B, const P extends PropertyPath.Paths<B>, R>(
|
||||||
|
this: ReffuseNamespace<R>,
|
||||||
|
props: {
|
||||||
|
readonly parent: SubscriptionRef.SubscriptionRef<B>,
|
||||||
|
readonly path: P,
|
||||||
|
readonly children: (subRef: SubscriptionSubRef.SubscriptionSubRef<PropertyPath.ValueFromPath<B, P>, B>) => React.ReactNode
|
||||||
|
},
|
||||||
|
): React.ReactNode {
|
||||||
|
return props.children(this.useSubRef(props.parent, props.path))
|
||||||
|
}
|
||||||
|
|
||||||
SubscribeRefs<
|
SubscribeRefs<
|
||||||
const Refs extends readonly SubscriptionRef.SubscriptionRef<any>[],
|
const Refs extends readonly SubscriptionRef.SubscriptionRef<any>[],
|
||||||
R,
|
R,
|
||||||
|
|||||||
Reference in New Issue
Block a user