fixed tRPC createInfiniteQuery no refresh when input change #1
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "solid-trpc",
|
||||
"version": "0.0.8",
|
||||
"version": "0.0.9",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "solid-trpc",
|
||||
"version": "0.0.8",
|
||||
"version": "0.0.9",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.18.13",
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
"description": "SolidJS tRPC",
|
||||
"author": "OrJDev",
|
||||
"license": "MIT",
|
||||
"version": "0.0.8",
|
||||
"version": "0.0.9",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
|
||||
+5
-4
@@ -176,9 +176,7 @@ export function createSolidQueryHooks<TRouter extends AnyRouter>() {
|
||||
TError
|
||||
>
|
||||
): CreateInfiniteQueryResult<TQueryValues[TPath]["output"], TError> {
|
||||
const [path, input] = pathAndInput();
|
||||
const ctx = useContext();
|
||||
|
||||
if (
|
||||
typeof window === "undefined" &&
|
||||
opts?.enabled !== false &&
|
||||
@@ -190,9 +188,12 @@ export function createSolidQueryHooks<TRouter extends AnyRouter>() {
|
||||
return __createInfiniteQuery(
|
||||
pathAndInput as any,
|
||||
({ pageParam }) => {
|
||||
const actualInput = { ...((input as any) ?? {}), cursor: pageParam };
|
||||
const actualInput = {
|
||||
...((pathAndInput()[1] as any) ?? {}),
|
||||
cursor: pageParam,
|
||||
};
|
||||
return (ctx.client as any).query(
|
||||
...getClientArgs([path, actualInput], opts)
|
||||
...getClientArgs([pathAndInput()[0], actualInput], opts)
|
||||
);
|
||||
},
|
||||
opts as any
|
||||
|
||||
Reference in New Issue
Block a user