Skip to content

Commit

Permalink
refactor: replace internal types with @tanstack/query-core types (#34)
Browse files Browse the repository at this point in the history
* refactor: replace internal types with @tanstack/query-core

* chore: add changeset

* chore: update changeset
  • Loading branch information
wconnorwalsh committed Jan 12, 2023
1 parent 4d56c4a commit abb3596
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-owls-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lukemorales/query-key-factory': minor
---

Replace internal types with official `@tanstack/query-core` types
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
"release": "changeset publish"
},
"dependencies": {},
"peerDependencies": {
"@tanstack/query-core": "^4.0.0"
},
"devDependencies": {
"@tanstack/query-core": "^4.0.0",
"@changesets/changelog-github": "^0.4.6",
"@changesets/cli": "^2.24.4",
"@commitlint/cli": "^17.1.2",
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 1 addition & 20 deletions src/query-context.types.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1 @@
export type QueryKey = readonly unknown[];

/**
* @internal use QueryFunction from "@tanstack/query-core" instead
*/
export type QueryFunction<T = unknown, TQueryKey extends QueryKey = QueryKey> = (
context?: QueryFunctionContext<TQueryKey>,
) => T | Promise<T>;

/**
* @internal use QueryFunctionContext from "@tanstack/query-core" instead
*/
export type QueryFunctionContext<TQueryKey extends QueryKey = QueryKey, TPageParam = any> = {
queryKey: TQueryKey;
signal?: AbortSignal;
pageParam?: TPageParam;
meta: QueryMeta | undefined;
};

type QueryMeta = Record<string, unknown>;
export type { QueryKey, QueryMeta, QueryFunction, QueryFunctionContext } from '@tanstack/query-core';

0 comments on commit abb3596

Please sign in to comment.