zsa-react-query
Advanced tools
+2
-2
| import * as _tanstack_react_query from '@tanstack/react-query'; | ||
| import { InfiniteData, GetNextPageParamFunction, UseInfiniteQueryResult, DefinedUseInfiniteQueryResult, UseQueryResult, DefinedUseQueryResult } from '@tanstack/react-query'; | ||
| import { InfiniteData, GetNextPageParamFunction, UseQueryResult, DefinedUseQueryResult } from '@tanstack/react-query'; | ||
| import { TAnyZodSafeFunctionHandler, inferServerActionReturnData, inferServerActionError, inferServerActionInput } from 'zsa'; | ||
@@ -23,3 +23,3 @@ | ||
| initialData?: TInitialData | undefined; | ||
| }, queryClient?: _tanstack_react_query.QueryClient | undefined) => TInitialData extends undefined ? UseInfiniteQueryResult<inferServerActionReturnData<THandler>, inferServerActionError<THandler>> : DefinedUseInfiniteQueryResult<inferServerActionReturnData<THandler>, inferServerActionError<THandler>>; | ||
| }, queryClient?: _tanstack_react_query.QueryClient | undefined) => _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<inferServerActionReturnData<THandler>, unknown>, inferServerActionError<THandler>>; | ||
| useServerActionQuery: <THandler_1 extends TAnyZodSafeFunctionHandler, TInitialData_1 extends inferServerActionReturnData<THandler_1> | (() => inferServerActionReturnData<THandler_1>) | undefined>(action: THandler_1, options: Omit<_tanstack_react_query.UseQueryOptions<inferServerActionReturnData<THandler_1>, inferServerActionError<THandler_1>, inferServerActionReturnData<THandler_1>, TFactory extends undefined ? readonly unknown[] : Readonly<ReturnType<Exclude<TFactory, undefined>[keyof Exclude<TFactory, undefined>]>>>, "queryFn" | "initialData"> & { | ||
@@ -26,0 +26,0 @@ input: inferServerActionInput<THandler_1>; |
+2
-2
| import * as _tanstack_react_query from '@tanstack/react-query'; | ||
| import { InfiniteData, GetNextPageParamFunction, UseInfiniteQueryResult, DefinedUseInfiniteQueryResult, UseQueryResult, DefinedUseQueryResult } from '@tanstack/react-query'; | ||
| import { InfiniteData, GetNextPageParamFunction, UseQueryResult, DefinedUseQueryResult } from '@tanstack/react-query'; | ||
| import { TAnyZodSafeFunctionHandler, inferServerActionReturnData, inferServerActionError, inferServerActionInput } from 'zsa'; | ||
@@ -23,3 +23,3 @@ | ||
| initialData?: TInitialData | undefined; | ||
| }, queryClient?: _tanstack_react_query.QueryClient | undefined) => TInitialData extends undefined ? UseInfiniteQueryResult<inferServerActionReturnData<THandler>, inferServerActionError<THandler>> : DefinedUseInfiniteQueryResult<inferServerActionReturnData<THandler>, inferServerActionError<THandler>>; | ||
| }, queryClient?: _tanstack_react_query.QueryClient | undefined) => _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<inferServerActionReturnData<THandler>, unknown>, inferServerActionError<THandler>>; | ||
| useServerActionQuery: <THandler_1 extends TAnyZodSafeFunctionHandler, TInitialData_1 extends inferServerActionReturnData<THandler_1> | (() => inferServerActionReturnData<THandler_1>) | undefined>(action: THandler_1, options: Omit<_tanstack_react_query.UseQueryOptions<inferServerActionReturnData<THandler_1>, inferServerActionError<THandler_1>, inferServerActionReturnData<THandler_1>, TFactory extends undefined ? readonly unknown[] : Readonly<ReturnType<Exclude<TFactory, undefined>[keyof Exclude<TFactory, undefined>]>>>, "queryFn" | "initialData"> & { | ||
@@ -26,0 +26,0 @@ input: inferServerActionInput<THandler_1>; |
+12
-3
@@ -39,3 +39,6 @@ "use strict"; | ||
| const input = options.input({ pageParam }); | ||
| const [data, err] = await action(input); | ||
| const result = await action(input); | ||
| if (!result) | ||
| return; | ||
| const [data, err] = result; | ||
| if (err) { | ||
@@ -55,3 +58,6 @@ throw err; | ||
| queryFn: async () => { | ||
| const [data, err] = await action(options.input); | ||
| const result = await action(options.input); | ||
| if (!result) | ||
| return; | ||
| const [data, err] = result; | ||
| if (err) { | ||
@@ -71,3 +77,6 @@ throw err; | ||
| mutationFn: async (...args2) => { | ||
| const [data, err] = await action(...args2); | ||
| const result = await action(...args2); | ||
| if (!result) | ||
| return; | ||
| const [data, err] = result; | ||
| if (options?.returnError) { | ||
@@ -74,0 +83,0 @@ return [data, err]; |
+12
-3
@@ -15,3 +15,6 @@ "use client"; | ||
| const input = options.input({ pageParam }); | ||
| const [data, err] = await action(input); | ||
| const result = await action(input); | ||
| if (!result) | ||
| return; | ||
| const [data, err] = result; | ||
| if (err) { | ||
@@ -31,3 +34,6 @@ throw err; | ||
| queryFn: async () => { | ||
| const [data, err] = await action(options.input); | ||
| const result = await action(options.input); | ||
| if (!result) | ||
| return; | ||
| const [data, err] = result; | ||
| if (err) { | ||
@@ -47,3 +53,6 @@ throw err; | ||
| mutationFn: async (...args2) => { | ||
| const [data, err] = await action(...args2); | ||
| const result = await action(...args2); | ||
| if (!result) | ||
| return; | ||
| const [data, err] = result; | ||
| if (options?.returnError) { | ||
@@ -50,0 +59,0 @@ return [data, err]; |
+1
-1
| { | ||
| "name": "zsa-react-query", | ||
| "version": "0.1.0", | ||
| "version": "0.1.1", | ||
| "publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
+2
-2
@@ -26,3 +26,3 @@ # zsa | ||
| View the full documentation and examples on [zsh.vercel.app](https://zsa.vercel.app/introduction). | ||
| View the full documentation and examples on [zsa.vercel.app](https://zsa.vercel.app/introduction). | ||
@@ -33,2 +33,2 @@ ## Support | ||
| ## [Contributors](https://github.com/vercel/ai/graphs/contributors) | ||
| ## [Contributors](https://github.com/IdoPesok/zsa/graphs/contributors) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14682
1.12%213
8.67%0
-100%