@prpc/solid
Advanced tools
@@ -19,3 +19,4 @@ 'use strict'; | ||
| }; | ||
| function mutation$(queryFn, key) { | ||
| function mutation$(...args) { | ||
| const { key, queryFn } = core.getParams(true, ...args); | ||
| return (mutationOpts) => { | ||
@@ -29,3 +30,4 @@ return solidQuery.createMutation(() => ({ | ||
| } | ||
| function query$(queryFn, key) { | ||
| function query$(...args) { | ||
| const { key, queryFn } = core.getParams(false, ...args); | ||
| return (input, queryOpts) => { | ||
@@ -32,0 +34,0 @@ return solidQuery.createQuery(() => ({ |
+4
-2
@@ -19,3 +19,4 @@ 'use strict'; | ||
| }; | ||
| function mutation$(queryFn, key) { | ||
| function mutation$(...args) { | ||
| const { key, queryFn } = core.getParams(true, ...args); | ||
| return (mutationOpts) => { | ||
@@ -29,3 +30,4 @@ return solidQuery.createMutation(() => ({ | ||
| } | ||
| function query$(queryFn, key) { | ||
| function query$(...args) { | ||
| const { key, queryFn } = core.getParams(false, ...args); | ||
| return (input, queryOpts) => { | ||
@@ -32,0 +34,0 @@ return solidQuery.createQuery(() => ({ |
+5
-3
| import { createComponent } from 'solid-js/web'; | ||
| import { QueryClientProvider, createMutation, createQuery, QueryClient } from '@tanstack/solid-query'; | ||
| import { genQueryKey, tryAndWrap, unwrapValue } from '@prpc/core'; | ||
| import { getParams, genQueryKey, tryAndWrap, unwrapValue } from '@prpc/core'; | ||
| export * from '@prpc/core'; | ||
@@ -18,3 +18,4 @@ | ||
| }; | ||
| function mutation$(queryFn, key) { | ||
| function mutation$(...args) { | ||
| const { key, queryFn } = getParams(true, ...args); | ||
| return (mutationOpts) => { | ||
@@ -28,3 +29,4 @@ return createMutation(() => ({ | ||
| } | ||
| function query$(queryFn, key) { | ||
| function query$(...args) { | ||
| const { key, queryFn } = getParams(false, ...args); | ||
| return (input, queryOpts) => { | ||
@@ -31,0 +33,0 @@ return createQuery(() => ({ |
+7
-3
@@ -14,5 +14,7 @@ // src/QueryProvider.tsx | ||
| genQueryKey, | ||
| tryAndWrap | ||
| tryAndWrap, | ||
| getParams | ||
| } from "@prpc/core"; | ||
| function mutation$(queryFn, key) { | ||
| function mutation$(...args) { | ||
| const { key, queryFn } = getParams(true, ...args); | ||
| return (mutationOpts) => { | ||
@@ -36,3 +38,5 @@ return createMutation(() => ({ | ||
| } from "@prpc/core"; | ||
| function query$(queryFn, key) { | ||
| import { getParams as getParams2 } from "@prpc/core"; | ||
| function query$(...args) { | ||
| const { key, queryFn } = getParams2(false, ...args); | ||
| return (input, queryOpts) => { | ||
@@ -39,0 +43,0 @@ return createQuery(() => ({ |
+4
-2
@@ -19,3 +19,4 @@ 'use strict'; | ||
| }; | ||
| function mutation$(queryFn, key) { | ||
| function mutation$(...args) { | ||
| const { key, queryFn } = core.getParams(true, ...args); | ||
| return (mutationOpts) => { | ||
@@ -29,3 +30,4 @@ return solidQuery.createMutation(() => ({ | ||
| } | ||
| function query$(queryFn, key) { | ||
| function query$(...args) { | ||
| const { key, queryFn } = core.getParams(false, ...args); | ||
| return (input, queryOpts) => { | ||
@@ -32,0 +34,0 @@ return solidQuery.createQuery(() => ({ |
+3
-1
| import { QueryClient, FunctionedParams, SolidMutationOptions, CreateMutationResult, QueryKey, SolidQueryOptions, CreateQueryResult } from '@tanstack/solid-query'; | ||
| import { ParentComponent } from 'solid-js'; | ||
| import zod from 'zod'; | ||
| import { PRPCClientError, OmitQueryData, IMiddleware, ExpectedFn, InferReturnType, AsParam } from '@prpc/core'; | ||
| import { PRPCClientError, OmitQueryData, IMiddleware, ExpectedFn, ObjectParams, AsParam, InferReturnType } from '@prpc/core'; | ||
| export * from '@prpc/core'; | ||
@@ -12,2 +12,3 @@ | ||
| type FCreateMutationOptions<TData = unknown, TError = PRPCClientError, TVariables = void, TContext = unknown> = FunctionedParams<OmitQueryData<SolidMutationOptions<TData, TError, TVariables, TContext>>>; | ||
| declare function mutation$<ZObj extends zod.ZodSchema | undefined, Mw extends IMiddleware[], Fn extends ExpectedFn<ZObj extends zod.ZodSchema ? zod.infer<ZObj> : undefined, Mw>>(params: ObjectParams<ZObj, Mw, Fn, true>): (input: AsParam<Fn>, queryOpts?: FCreateMutationOptions<InferReturnType<Fn>, PRPCClientError<ZObj extends zod.ZodSchema ? zod.infer<ZObj> : any>, AsParam<Fn, false>>) => CreateMutationResult<InferReturnType<Fn>, PRPCClientError<ZObj extends zod.ZodSchema ? zod.infer<ZObj> : any>, AsParam<Fn, false>>; | ||
| declare function mutation$<Mw extends IMiddleware[], Fn extends ExpectedFn<undefined, Mw>>(queryFn: Fn, key: string, ..._middlewares: Mw): (mutationOpts?: FCreateMutationOptions<InferReturnType<Fn>, PRPCClientError<any>, AsParam<Fn, false>>) => CreateMutationResult<InferReturnType<Fn>, PRPCClientError<any>, AsParam<Fn, false>>; | ||
@@ -17,2 +18,3 @@ declare function mutation$<ZObj extends zod.ZodSchema | undefined, Mw extends IMiddleware[], Fn extends ExpectedFn<ZObj extends zod.ZodSchema ? zod.infer<ZObj> : undefined, Mw>>(queryFn: Fn, key: string, _schema?: ZObj, ..._middlewares: Mw): (mutationOpts?: FCreateMutationOptions<InferReturnType<Fn>, PRPCClientError<ZObj extends zod.ZodSchema ? zod.infer<ZObj> : any>, AsParam<Fn, false>>) => CreateMutationResult<InferReturnType<Fn>, PRPCClientError<ZObj extends zod.ZodSchema ? zod.infer<ZObj> : any>, AsParam<Fn, false>>; | ||
| type FCreateQueryOptions<TQueryFnData = unknown, TError = PRPCClientError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = FunctionedParams<OmitQueryData<SolidQueryOptions<TQueryFnData, TError, TData, TQueryKey>>>; | ||
| declare function query$<ZObj extends zod.ZodSchema | undefined, Mw extends IMiddleware[], Fn extends ExpectedFn<ZObj extends zod.ZodSchema ? zod.infer<ZObj> : undefined, Mw>>(params: ObjectParams<ZObj, Mw, Fn>): (input: AsParam<Fn>, queryOpts?: FCreateQueryOptions<InferReturnType<Fn>, PRPCClientError<ZObj extends zod.ZodSchema ? zod.infer<ZObj> : any>>) => CreateQueryResult<InferReturnType<Fn>, PRPCClientError<ZObj extends zod.ZodSchema ? zod.infer<ZObj> : any>>; | ||
| declare function query$<Mw extends IMiddleware[], Fn extends ExpectedFn<undefined, Mw>>(queryFn: Fn, key: string, ..._middlewares: Mw): (input: AsParam<Fn>, queryOpts?: FCreateQueryOptions<InferReturnType<Fn>, PRPCClientError<any>>) => CreateQueryResult<InferReturnType<Fn>, PRPCClientError<any>>; | ||
@@ -19,0 +21,0 @@ declare function query$<ZObj extends zod.ZodSchema | undefined, Mw extends IMiddleware[], Fn extends ExpectedFn<ZObj extends zod.ZodSchema ? zod.infer<ZObj> : undefined, Mw>>(queryFn: Fn, key: string, _schema?: ZObj, ..._middlewares: Mw): (input: AsParam<Fn>, queryOpts?: FCreateQueryOptions<InferReturnType<Fn>, PRPCClientError<ZObj extends zod.ZodSchema ? zod.infer<ZObj> : any>>) => CreateQueryResult<InferReturnType<Fn>, PRPCClientError<ZObj extends zod.ZodSchema ? zod.infer<ZObj> : any>>; |
+5
-3
| import { createComponent } from 'solid-js/web'; | ||
| import { QueryClientProvider, createMutation, createQuery, QueryClient } from '@tanstack/solid-query'; | ||
| import { genQueryKey, tryAndWrap, unwrapValue } from '@prpc/core'; | ||
| import { getParams, genQueryKey, tryAndWrap, unwrapValue } from '@prpc/core'; | ||
| export * from '@prpc/core'; | ||
@@ -18,3 +18,4 @@ | ||
| }; | ||
| function mutation$(queryFn, key) { | ||
| function mutation$(...args) { | ||
| const { key, queryFn } = getParams(true, ...args); | ||
| return (mutationOpts) => { | ||
@@ -28,3 +29,4 @@ return createMutation(() => ({ | ||
| } | ||
| function query$(queryFn, key) { | ||
| function query$(...args) { | ||
| const { key, queryFn } = getParams(false, ...args); | ||
| return (input, queryOpts) => { | ||
@@ -31,0 +33,0 @@ return createQuery(() => ({ |
+7
-3
@@ -14,5 +14,7 @@ // src/QueryProvider.tsx | ||
| genQueryKey, | ||
| tryAndWrap | ||
| tryAndWrap, | ||
| getParams | ||
| } from "@prpc/core"; | ||
| function mutation$(queryFn, key) { | ||
| function mutation$(...args) { | ||
| const { key, queryFn } = getParams(true, ...args); | ||
| return (mutationOpts) => { | ||
@@ -36,3 +38,5 @@ return createMutation(() => ({ | ||
| } from "@prpc/core"; | ||
| function query$(queryFn, key) { | ||
| import { getParams as getParams2 } from "@prpc/core"; | ||
| function query$(...args) { | ||
| const { key, queryFn } = getParams2(false, ...args); | ||
| return (input, queryOpts) => { | ||
@@ -39,0 +43,0 @@ return createQuery(() => ({ |
+4
-2
@@ -19,3 +19,4 @@ 'use strict'; | ||
| }; | ||
| function mutation$(queryFn, key) { | ||
| function mutation$(...args) { | ||
| const { key, queryFn } = core.getParams(true, ...args); | ||
| return (mutationOpts) => { | ||
@@ -29,3 +30,4 @@ return solidQuery.createMutation(() => ({ | ||
| } | ||
| function query$(queryFn, key) { | ||
| function query$(...args) { | ||
| const { key, queryFn } = core.getParams(false, ...args); | ||
| return (input, queryOpts) => { | ||
@@ -32,0 +34,0 @@ return solidQuery.createQuery(() => ({ |
+5
-3
| import { createComponent } from 'solid-js/web'; | ||
| import { QueryClientProvider, createMutation, createQuery, QueryClient } from '@tanstack/solid-query'; | ||
| import { genQueryKey, tryAndWrap, unwrapValue } from '@prpc/core'; | ||
| import { getParams, genQueryKey, tryAndWrap, unwrapValue } from '@prpc/core'; | ||
| export * from '@prpc/core'; | ||
@@ -18,3 +18,4 @@ | ||
| }; | ||
| function mutation$(queryFn, key) { | ||
| function mutation$(...args) { | ||
| const { key, queryFn } = getParams(true, ...args); | ||
| return (mutationOpts) => { | ||
@@ -28,3 +29,4 @@ return createMutation(() => ({ | ||
| } | ||
| function query$(queryFn, key) { | ||
| function query$(...args) { | ||
| const { key, queryFn } = getParams(false, ...args); | ||
| return (input, queryOpts) => { | ||
@@ -31,0 +33,0 @@ return createQuery(() => ({ |
+7
-3
@@ -14,5 +14,7 @@ // src/QueryProvider.tsx | ||
| genQueryKey, | ||
| tryAndWrap | ||
| tryAndWrap, | ||
| getParams | ||
| } from "@prpc/core"; | ||
| function mutation$(queryFn, key) { | ||
| function mutation$(...args) { | ||
| const { key, queryFn } = getParams(true, ...args); | ||
| return (mutationOpts) => { | ||
@@ -36,3 +38,5 @@ return createMutation(() => ({ | ||
| } from "@prpc/core"; | ||
| function query$(queryFn, key) { | ||
| import { getParams as getParams2 } from "@prpc/core"; | ||
| function query$(...args) { | ||
| const { key, queryFn } = getParams2(false, ...args); | ||
| return (input, queryOpts) => { | ||
@@ -39,0 +43,0 @@ return createQuery(() => ({ |
+2
-2
| { | ||
| "name": "@prpc/solid", | ||
| "description": "Package for easily creating server rpc functions in solid-start with goodies baked in", | ||
| "version": "0.2.21", | ||
| "version": "0.2.22", | ||
| "type": "module", | ||
@@ -85,3 +85,3 @@ "exports": { | ||
| "dependencies": { | ||
| "@prpc/core": "0.3.6" | ||
| "@prpc/core": "0.3.7" | ||
| }, | ||
@@ -88,0 +88,0 @@ "peerDependencies": { |
20990
12.02%466
6.88%+ Added
- Removed
Updated