feat: simplify caching — TanStack Query as single source of truth (#6075)
This commit is contained in:
1 parent
a5ec880eec
commit
f19033e0d5
187 files changed
+1013
-4712
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import { createRequestHandler } from "./request-handler";
|
||||
|
||||
interface Options<TData, TInput extends Record<string, unknown>> {
|
||||
requestAsync: (input: TInput) => Promise<TData>;
|
||||
}
|
||||
|
||||
export const createWidgetRequestHandler = <TData, TInput extends Record<string, unknown>>(
|
||||
options: Options<TData, TInput>,
|
||||
) => ({
|
||||
handler: (widgetOptions: TInput) =>
|
||||
createRequestHandler<TData, TInput>({
|
||||
requestAsync: options.requestAsync,
|
||||
}).handler(widgetOptions),
|
||||
});
|
||||
Reference in new issue
Block a user