@refinedev/core
Version:
refine is a React-based framework for building internal tools, rapidly. It ships with Ant Design System, an enterprise-level UI toolkit.
20 lines (16 loc) • 476 B
text/typescript
import type { QueryFunctionContext, QueryKey } from "@tanstack/react-query";
export const prepareQueryContext = (
context: QueryFunctionContext<QueryKey, any>,
): Omit<QueryFunctionContext<QueryKey, any>, "meta"> => {
const queryContext = {
queryKey: context.queryKey,
pageParam: context.pageParam,
};
Object.defineProperty(queryContext, "signal", {
enumerable: true,
get: () => {
return context.signal;
},
});
return queryContext;
};