0.1.0 #1
@@ -50,3 +50,20 @@ export type R<T> = T extends ReffuseContext<infer R> ? R : never
|
|||||||
export function make<R = never>() {
|
export function make<R = never>() {
|
||||||
return new ReffuseContext<R>()
|
return new ReffuseContext<R>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function useMergeMany<
|
||||||
|
const Contexts extends readonly ReffuseContext<any>[]
|
||||||
|
>(
|
||||||
|
contexts: Contexts
|
||||||
|
): {
|
||||||
|
[K in keyof Contexts]: R<Contexts[K]>
|
||||||
|
} {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const context1 = make<{ readonly service1: true }>()
|
||||||
|
const context2 = make<{ readonly service2: true }>()
|
||||||
|
|
||||||
|
const res = useMergeMany([context1, context2])
|
||||||
|
|||||||
Reference in New Issue
Block a user