treat pathandinput as solid accessor

This commit is contained in:
OrJDev
2022-11-05 02:29:59 +02:00
parent df8aa2b9ec
commit efe56dc44d
6 changed files with 64 additions and 55 deletions
+4 -3
View File
@@ -26,8 +26,9 @@ export function createSolidProxyDecoration<
return (hooks as any)[lastArg](path, ...args);
}
const [input, ...rest] = args;
const queryKey = getQueryKey(path, input);
return (hooks as any)[lastArg](queryKey, ...rest);
return (hooks as any)[lastArg](
() => getQueryKey(path, typeof input === "function" ? input() : input),
() => rest.map((arg) => (typeof arg === "function" ? arg() : arg))
);
});
}