44<br />
55
66<p align =" center " >
7- <a aria-label =" NPM version " href =" https://quaere-site.vercel.app " >
7+ <a aria-label =" NPM version " href =" ./assets/logo.svg " >
88 <img alt="" src="./assets/logo.svg" height="40">
99 </a >
1010</p >
1414<p align =" center " >
1515 <a href =" https://github.com/liaoliao666/react-query-kit/actions/workflows/tests.yml " ><img src =" https://github.com/liaoliao666/react-query-kit/actions/workflows/tests.yml/badge.svg?branch=main " alt =" Latest build " target =" \_parent " ></a >
1616 <a href =" https://www.npmjs.com/package/react-query-kit " ><img src =" https://badgen.net/npm/v/react-query-kit " alt =" Latest published version " target =" \_parent " ></a >
17- <a href =" https://unpkg.com/browse/react-query-kit@latest/build/umd/index.production .js " rel =" nofollow " ><img src =" https://img.badgesize.io/https:/unpkg.com/react-query-kit@latest/build/umd/index.production .js?label=gzip%20size&compression=gzip " alt =" gzip size " ></a >
17+ <a href =" https://unpkg.com/browse/react-query-kit@latest/build/zip/zip.esm .js " rel =" nofollow " ><img src =" https://img.badgesize.io/https:/unpkg.com/react-query-kit@latest/build/zip/zip.esm .js?label=gzip%20size&compression=gzip " alt =" gzip size " ></a >
1818 <a href =" https://github.com/liaoliao666/react-query-kit " ><img src =" https://badgen.net/npm/types/react-query-kit " alt =" Types included " target =" \_parent " ></a >
1919 <a href =" https://github.com/liaoliao666/react-query-kit/blob/main/LICENSE " ><img src =" https://badgen.net/npm/license/react-query-kit " alt =" License " target =" \_parent " ></a >
2020 <a href =" https://www.npmjs.com/package/react-query-kit " ><img src =" https://badgen.net/npm/dt/react-query-kit " alt =" Number of downloads " target =" \_parent " ></a >
@@ -93,7 +93,6 @@ const usePost = createQuery<Response, Variables, Error>({
9393 // primaryKey equals to '/posts'
9494 return fetch (` ${primaryKey }/${variables .id } ` ).then (res => res .json ())
9595 },
96- suspense: true ,
9796 // u can also pass middleware to cutomize this hook's behavior
9897 use: [myMiddleware ]
9998})
@@ -104,7 +103,7 @@ const variables = { id: 1 }
104103// example
105104export default function Page() {
106105 // queryKey equals to ['/posts', { id: 1 }]
107- const { data } = usePost ({ variables , suspense: true })
106+ const { data } = usePost ({ variables })
108107
109108 return (
110109 <div >
@@ -160,9 +159,9 @@ Expose Methods
160159
161160- ` getPrimaryKey: () => primaryKey `
162161- ` getKey: (variables: TVariables) => [primaryKey, variables] `
163- - ` getFetchOptions: (variables: TVariables) => {queryKey, queryFn, queryKeyHashFn} `
164162- ` queryFn: QueryFunction<TFnData, [primaryKey, TVariables]> `
165163- ` queryKeyHashFn: (queryKey: [primaryKey, TVariables]) => string `
164+ - ` getFetchOptions: (variables: TVariables) => ({ queryKey, queryFn, queryKeyHashFn }) `
166165
167166## createInfiniteQuery
168167
@@ -192,7 +191,7 @@ const variables = { active: true }
192191export default function Page() {
193192 // queryKey equals to ['projects', { active: true }]
194193 const { data, fetchNextPage, hasNextPage, isFetching, isFetchingNextPage } =
195- useProjects ({ variables , suspense: true })
194+ useProjects ({ variables })
196195
197196 return (
198197 <div >
@@ -256,9 +255,9 @@ Expose Methods
256255
257256- ` getPrimaryKey: () => primaryKey `
258257- ` getKey: (variables: TVariables) => [primaryKey, variables] `
259- - ` getFetchOptions: (variables: TVariables) => {queryKey, queryFn, queryKeyHashFn, getNextPageParam, getPreviousPageParam, initialPageParam} `
260258- ` queryFn: QueryFunction<TFnData, [primaryKey, TVariables]> `
261259- ` queryKeyHashFn: (queryKey: [primaryKey, TVariables]) => string `
260+ - ` getFetchOptions: (variables: TVariables) => ({ queryKey, queryFn, queryKeyHashFn, getNextPageParam, getPreviousPageParam, initialPageParam }) `
262261
263262## createSuspenseQuery
264263
0 commit comments