UNPKG

@refinedev/core

Version:

Refine is a React meta-framework for building enterprise-level, data-intensive applications rapidly with support for modern UI libraries and headless integrations.

20 lines (16 loc) 476 B
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; };