Skip to content

Commit 369f827

Browse files
author
liaoliao666
committed
docs: replace badge
1 parent 5e3147e commit 369f827

2 files changed

Lines changed: 14 additions & 18 deletions

File tree

README-zh_CN.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
<p align="center">
77
<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>
88
<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>
9-
<a href="https://bundlephobia.com/package/react-query-kit@latest"><img src="https://badgen.net/bundlephobia/minzip/react-query-kit" alt="Bundlephobia" target="\_parent"></a>
10-
<a href="https://bundlephobia.com/package/react-query-kit@latest"><img src="https://badgen.net/bundlephobia/dependency-count/react-query-kit" alt="Dependency count 0" target="\_parent"></a>
9+
<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>
1110
<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>
1211
<a href="https://www.npmjs.com/package/react-query-kit"><img src="https://badgen.net/npm/license/react-query-kit" alt="License" target="\_parent"></a>
1312
<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>
@@ -155,7 +154,7 @@ Options
155154
- 如果设置为函数,该函数将使用最新数据执行以计算布尔值
156155
- `useDefaultOptions: () => QueryHookOptions`
157156
- 可选
158-
- 如果你想将其他钩子的返回值注入到当前query中,你可以使用这个选项。
157+
- 如果你想将其他钩子的返回值注入到当前 query 中,你可以使用这个选项。
159158

160159
Expose Methods
161160

@@ -167,9 +166,9 @@ Expose Methods
167166
Returns
168167

169168
- `queryKey: [primaryKey, TVariables]`
170-
- 自定义hook的queryKey.
169+
- 自定义 hook 的 queryKey.
171170
- `variables: TVariables`
172-
- 自定义hook的variables.
171+
- 自定义 hook 的 variables.
173172
- `setData: (updater: Updater<TData>, options?: SetDataOptions) => TData | undefined`
174173
- 它的参数与 `queryClient.setQueryData` 类似,但不需要传入 `queryKey`
175174

@@ -192,7 +191,7 @@ const useProjects = createInfiniteQuery<Response, Variables, Error>({
192191
).then(res => res.json())
193192
},
194193
getNextPageParam: (lastPage, pages) => lastPage.nextCursor,
195-
defaultPageParam: 1
194+
defaultPageParam: 1,
196195
})
197196

198197
const variables = { active: true }
@@ -265,7 +264,7 @@ Options
265264
- 如果设置为函数,该函数将使用最新数据执行以计算布尔值
266265
- `useDefaultOptions: () => InfiniteQueryHookOptions`
267266
- 可选
268-
- 如果你想将其他钩子的返回值注入到当前query中,你可以使用这个选项。
267+
- 如果你想将其他钩子的返回值注入到当前 query 中,你可以使用这个选项。
269268

270269
Expose Methods
271270

@@ -277,9 +276,9 @@ Expose Methods
277276
Returns
278277

279278
- `queryKey: [primaryKey, TVariables]`
280-
- 自定义hook的queryKey.
279+
- 自定义 hook 的 queryKey.
281280
- `variables: TVariables`
282-
- 自定义hook的variables.
281+
- 自定义 hook 的 variables.
283282
- `setData: (updater: Updater<TData>, options?: SetDataOptions) => TData | undefined`
284283
- 它的参数与 `queryClient.setQueryData` 类似,但不需要传入 `queryKey`
285284

@@ -349,8 +348,7 @@ Options
349348

350349
- `useDefaultOptions: () => MutationHookOptions`
351350
- 可选
352-
- 如果你想将其他钩子的返回值注入到当前mutation中,你可以使用这个选项。
353-
351+
- 如果你想将其他钩子的返回值注入到当前 mutation 中,你可以使用这个选项。
354352

355353
Returns
356354

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
<p align="center">
77
<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>
88
<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>
9-
<a href="https://bundlephobia.com/package/react-query-kit@latest"><img src="https://badgen.net/bundlephobia/minzip/react-query-kit" alt="Bundlephobia" target="\_parent"></a>
10-
<a href="https://bundlephobia.com/package/react-query-kit@latest"><img src="https://badgen.net/bundlephobia/dependency-count/react-query-kit" alt="Dependency count 0" target="\_parent"></a>
9+
<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>
1110
<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>
1211
<a href="https://www.npmjs.com/package/react-query-kit"><img src="https://badgen.net/npm/license/react-query-kit" alt="License" target="\_parent"></a>
1312
<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>
@@ -120,7 +119,7 @@ export async function getStaticProps() {
120119
const queryClient = new QueryClient()
121120

122121
await queryClient.prefetchQuery({
123-
queryKey: usePost.getKey(variables),
122+
queryKey: usePost.getKey(variables),
124123
queryFn: usePost.queryFn
125124
})
126125

@@ -133,7 +132,7 @@ export async function getStaticProps() {
133132

134133
// usage outside of react component
135134
const data = await queryClient.fetchQuery({
136-
queryKey: usePost.getKey(variables),
135+
queryKey: usePost.getKey(variables),
137136
queryFn: usePost.queryFn
138137
})
139138

@@ -199,7 +198,7 @@ const useProjects = createInfiniteQuery<Response, Variables, Error>({
199198
).then(res => res.json())
200199
},
201200
getNextPageParam: (lastPage, pages) => lastPage.nextCursor,
202-
defaultPageParam: 1
201+
defaultPageParam: 1,
203202
})
204203

205204
const variables = { active: true }
@@ -258,7 +257,6 @@ const data = await queryClient.fetchInfiniteQuery({
258257
queryFn: useProjects.queryFn,
259258
})
260259

261-
262260
// usage outside of react component
263261
const data = await queryClient.fetchInfiniteQuery({
264262
queryKey: useProjects.getKey(variables),
@@ -376,7 +374,7 @@ You can extract the TypeScript type of any custom hook with `inferVariables` or
376374
import { inferVariables, inferData, inferFnData } from 'react-query-kit'
377375

378376
type Variables = inferVariables<typeof usePost>
379-
type Data = inferData<typeof usePost>
377+
type Data = inferData<typeof usePost>
380378
type FnData = inferFnData<typeof usePost>
381379
```
382380

0 commit comments

Comments
 (0)