0.1.0 #1
@@ -14,7 +14,7 @@ export class Reffuse<
|
||||
readonly Provider: ReffuseReactContext.Provider<RuntimeR, OwnContextR, ParentContextR>
|
||||
|
||||
constructor(
|
||||
runtime: Runtime.Runtime<RuntimeR>,
|
||||
readonly runtime: Runtime.Runtime<RuntimeR>,
|
||||
parent?: Reffuse<RuntimeR, ParentContextR, unknown, unknown>,
|
||||
) {
|
||||
this.Provider = parent
|
||||
@@ -22,6 +22,15 @@ export class Reffuse<
|
||||
: ReffuseReactContext.makeRootProvider(runtime, this.Context)
|
||||
}
|
||||
|
||||
extend<OwnContextR = never>() {
|
||||
return new Reffuse<
|
||||
RuntimeR,
|
||||
ContextR | OwnContextR,
|
||||
OwnContextR,
|
||||
ContextR
|
||||
>(this.runtime, this)
|
||||
}
|
||||
|
||||
|
||||
useRuntime(): Runtime.Runtime<RuntimeR> {
|
||||
return React.useContext(this.Context).runtime
|
||||
|
||||
Reference in New Issue
Block a user