rename react to solid
This commit is contained in:
@@ -644,10 +644,10 @@ type fooType<TRouter extends AnyRouter, TSSRContext = unknown> = GnClass<
|
||||
>["fn"];
|
||||
|
||||
/**
|
||||
* Infer the type of a `createReactQueryHooks` function
|
||||
* Infer the type of a `createSolidQueryHooks` function
|
||||
* @internal
|
||||
*/
|
||||
export type CreateReactQueryHooks<
|
||||
export type CreateSolidQueryHooks<
|
||||
TRouter extends AnyRouter,
|
||||
TSSRContext = unknown
|
||||
> = returnTypeInferer<fooType<TRouter, TSSRContext>>;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { AnyRouter } from "@trpc/server";
|
||||
import { createRecursiveProxy } from "@trpc/server/shared";
|
||||
import { getQueryKey } from "../../internals/getQueryKey";
|
||||
import { CreateReactQueryHooks } from "../hooks/createHooksInternal";
|
||||
import { type CreateSolidQueryHooks } from "../hooks/createHooksInternal";
|
||||
|
||||
/**
|
||||
* Create proxy for decorating procedures
|
||||
* @internal
|
||||
*/
|
||||
export function createReactProxyDecoration<
|
||||
export function createSolidProxyDecoration<
|
||||
TRouter extends AnyRouter,
|
||||
TSSRContext = unknown
|
||||
>(name: string, hooks: CreateReactQueryHooks<TRouter, TSSRContext>) {
|
||||
>(name: string, hooks: CreateSolidQueryHooks<TRouter, TSSRContext>) {
|
||||
return createRecursiveProxy((opts) => {
|
||||
const args = opts.args;
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ export type DecoratedProcedureUtilsRecord<TRouter extends AnyRouter> = {
|
||||
|
||||
type AnyDecoratedProcedure = DecorateProcedure<any, any>;
|
||||
|
||||
export type CreateReactUtilsProxy<
|
||||
export type CreateSolidUtilsProxy<
|
||||
TRouter extends AnyRouter,
|
||||
TSSRContext
|
||||
> = DecoratedProcedureUtilsRecord<TRouter> &
|
||||
@@ -198,16 +198,16 @@ export type CreateReactUtilsProxy<
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function createReactQueryUtilsProxy<
|
||||
export function createSolidQueryUtilsProxy<
|
||||
TRouter extends AnyRouter,
|
||||
TSSRContext
|
||||
>(context: TRPCContextState<AnyRouter, unknown>) {
|
||||
type CreateReactUtilsProxyReturnType = CreateReactUtilsProxy<
|
||||
type CreateSolidUtilsProxyReturnType = CreateSolidUtilsProxy<
|
||||
TRouter,
|
||||
TSSRContext
|
||||
>;
|
||||
|
||||
return createFlatProxy<CreateReactUtilsProxyReturnType>((key) => {
|
||||
return createFlatProxy<CreateSolidUtilsProxyReturnType>((key) => {
|
||||
const contextName = key as typeof contextProps[number];
|
||||
if (contextProps.includes(contextName)) {
|
||||
return context[contextName];
|
||||
|
||||
Reference in New Issue
Block a user