@reffuse/extension-query 0.1.5 #16
@@ -384,7 +384,17 @@ export interface ScopeOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const make = <T extends Array<unknown>>(
|
// export const make = <T extends Array<unknown>>(
|
||||||
...contexts: [...{ [K in keyof T]: ReffuseContext.ReffuseContext<T[K]> }]
|
// ...contexts: [...{ [K in keyof T]: ReffuseContext.ReffuseContext<T[K]> }]
|
||||||
): Reffuse<T[number]> =>
|
// ): Reffuse<T[number]> =>
|
||||||
new Reffuse(contexts)
|
// new Reffuse(contexts)
|
||||||
|
|
||||||
|
export const make = (): Reffuse<never> => new Reffuse([])
|
||||||
|
|
||||||
|
export const withContexts = <R2 extends Array<unknown>>(
|
||||||
|
...contexts: [...{ [K in keyof R2]: ReffuseContext.ReffuseContext<R2[K]> }]
|
||||||
|
) =>
|
||||||
|
<T extends Reffuse<R1>, R1>(self: T & Reffuse<R1>): (
|
||||||
|
Reffuse<R1 | R2[number]> & Exclude<T, Reffuse<R1>>
|
||||||
|
) =>
|
||||||
|
new Reffuse([...self.contexts, ...contexts as any]) as any
|
||||||
|
|||||||
Reference in New Issue
Block a user