react-query-kit 1.2.6 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  <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>
8
8
  <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
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/tree-shaking/react-query-kit" alt="Tree shaking available" 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>
11
11
  <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>
12
12
  <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>
13
13
  <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>
@@ -17,12 +17,13 @@
17
17
 
18
18
  ---
19
19
 
20
- ## Motivation
20
+ ## What could you benefit from it
21
21
 
22
- People will face with these pain points when writing ReactQuery hooks.
23
- - Share a custom hook between multiple components
24
- - how to combining `queryKey` with `queryClient` in a type-safe way
25
- - Set `defaultOptions` for specific custom hooks
22
+ - Make `queryKey` strongly related with `queryFn`
23
+ - Manage `queryKey` in a type-safe way
24
+ - Generate quickly a custom ReactQuery hook
25
+ - Make `queryClient`'s operations more clearly associated with which custom ReactQuery hook
26
+ - Set defaultOptions for custom ReactQuery hooks easier and clearer
26
27
 
27
28
  ![react-query-kit.gif](https://files.catbox.moe/9na7tp.gif)
28
29
 
@@ -52,9 +53,9 @@ This module is distributed via [npm][npm] which is bundled with [node][node] and
52
53
  should be installed as one of your project's `dependencies`:
53
54
 
54
55
  ```bash
55
- $ npm i @tanstack/react-query-kit @tanstack/react-query
56
+ $ npm i react-query-kit
56
57
  # or
57
- $ yarn add @tanstack/react-query-kit @tanstack/react-query
58
+ $ yarn add react-query-kit
58
59
  ```
59
60
 
60
61
  # Examples
@@ -4014,7 +4014,7 @@ var drawChart = (function (exports) {
4014
4014
  </script>
4015
4015
  <script>
4016
4016
  /*<!--*/
4017
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"src","children":[{"uid":"d939-1","name":"createBaseQuery.ts"},{"uid":"d939-3","name":"utils.ts"},{"uid":"d939-5","name":"createInfiniteQuery.ts"},{"uid":"d939-7","name":"createMutation.ts"},{"uid":"d939-9","name":"createQuery.tsx"},{"uid":"d939-11","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"d939-1":{"renderedLength":1201,"gzipLength":427,"brotliLength":0,"mainUid":"d939-0"},"d939-3":{"renderedLength":292,"gzipLength":169,"brotliLength":0,"mainUid":"d939-2"},"d939-5":{"renderedLength":177,"gzipLength":131,"brotliLength":0,"mainUid":"d939-4"},"d939-7":{"renderedLength":457,"gzipLength":211,"brotliLength":0,"mainUid":"d939-6"},"d939-9":{"renderedLength":161,"gzipLength":121,"brotliLength":0,"mainUid":"d939-8"},"d939-11":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"d939-10"}},"nodeMetas":{"d939-0":{"id":"/src/createBaseQuery.ts","moduleParts":{"index.production.js":"d939-1"},"imported":[{"uid":"d939-12"}],"importedBy":[{"uid":"d939-4"},{"uid":"d939-8"}]},"d939-2":{"id":"/src/utils.ts","moduleParts":{"index.production.js":"d939-3"},"imported":[],"importedBy":[{"uid":"d939-4"},{"uid":"d939-8"}]},"d939-4":{"id":"/src/createInfiniteQuery.ts","moduleParts":{"index.production.js":"d939-5"},"imported":[{"uid":"d939-12"},{"uid":"d939-0"},{"uid":"d939-2"}],"importedBy":[{"uid":"d939-10"}]},"d939-6":{"id":"/src/createMutation.ts","moduleParts":{"index.production.js":"d939-7"},"imported":[{"uid":"d939-12"}],"importedBy":[{"uid":"d939-10"}]},"d939-8":{"id":"/src/createQuery.tsx","moduleParts":{"index.production.js":"d939-9"},"imported":[{"uid":"d939-12"},{"uid":"d939-0"},{"uid":"d939-2"}],"importedBy":[{"uid":"d939-10"}]},"d939-10":{"id":"/src/index.ts","moduleParts":{"index.production.js":"d939-11"},"imported":[{"uid":"d939-4"},{"uid":"d939-6"},{"uid":"d939-8"}],"importedBy":[],"isEntry":true},"d939-12":{"id":"@tanstack/react-query","moduleParts":{},"imported":[],"importedBy":[{"uid":"d939-4"},{"uid":"d939-6"},{"uid":"d939-8"},{"uid":"d939-0"}],"isExternal":true}},"env":{"rollup":"2.77.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4017
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"src","children":[{"uid":"75ce-1","name":"createBaseQuery.ts"},{"uid":"75ce-3","name":"utils.ts"},{"uid":"75ce-5","name":"createInfiniteQuery.ts"},{"uid":"75ce-7","name":"createMutation.ts"},{"uid":"75ce-9","name":"createQuery.tsx"},{"uid":"75ce-11","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"75ce-1":{"renderedLength":1201,"gzipLength":427,"brotliLength":0,"mainUid":"75ce-0"},"75ce-3":{"renderedLength":292,"gzipLength":169,"brotliLength":0,"mainUid":"75ce-2"},"75ce-5":{"renderedLength":177,"gzipLength":131,"brotliLength":0,"mainUid":"75ce-4"},"75ce-7":{"renderedLength":457,"gzipLength":211,"brotliLength":0,"mainUid":"75ce-6"},"75ce-9":{"renderedLength":161,"gzipLength":121,"brotliLength":0,"mainUid":"75ce-8"},"75ce-11":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"75ce-10"}},"nodeMetas":{"75ce-0":{"id":"/src/createBaseQuery.ts","moduleParts":{"index.production.js":"75ce-1"},"imported":[{"uid":"75ce-12"}],"importedBy":[{"uid":"75ce-4"},{"uid":"75ce-8"}]},"75ce-2":{"id":"/src/utils.ts","moduleParts":{"index.production.js":"75ce-3"},"imported":[],"importedBy":[{"uid":"75ce-4"},{"uid":"75ce-8"}]},"75ce-4":{"id":"/src/createInfiniteQuery.ts","moduleParts":{"index.production.js":"75ce-5"},"imported":[{"uid":"75ce-12"},{"uid":"75ce-0"},{"uid":"75ce-2"}],"importedBy":[{"uid":"75ce-10"}]},"75ce-6":{"id":"/src/createMutation.ts","moduleParts":{"index.production.js":"75ce-7"},"imported":[{"uid":"75ce-12"}],"importedBy":[{"uid":"75ce-10"}]},"75ce-8":{"id":"/src/createQuery.tsx","moduleParts":{"index.production.js":"75ce-9"},"imported":[{"uid":"75ce-12"},{"uid":"75ce-0"},{"uid":"75ce-2"}],"importedBy":[{"uid":"75ce-10"}]},"75ce-10":{"id":"/src/index.ts","moduleParts":{"index.production.js":"75ce-11"},"imported":[{"uid":"75ce-4"},{"uid":"75ce-6"},{"uid":"75ce-8"}],"importedBy":[],"isEntry":true},"75ce-12":{"id":"@tanstack/react-query","moduleParts":{},"imported":[],"importedBy":[{"uid":"75ce-4"},{"uid":"75ce-6"},{"uid":"75ce-8"},{"uid":"75ce-0"}],"isExternal":true}},"env":{"rollup":"2.77.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4018
4018
 
4019
4019
  const run = () => {
4020
4020
  const width = window.innerWidth;
package/build/stats.json CHANGED
@@ -10,27 +10,27 @@
10
10
  "name": "src",
11
11
  "children": [
12
12
  {
13
- "uid": "d939-14",
13
+ "uid": "75ce-14",
14
14
  "name": "createBaseQuery.ts"
15
15
  },
16
16
  {
17
- "uid": "d939-16",
17
+ "uid": "75ce-16",
18
18
  "name": "utils.ts"
19
19
  },
20
20
  {
21
- "uid": "d939-18",
21
+ "uid": "75ce-18",
22
22
  "name": "createInfiniteQuery.ts"
23
23
  },
24
24
  {
25
- "uid": "d939-20",
25
+ "uid": "75ce-20",
26
26
  "name": "createMutation.ts"
27
27
  },
28
28
  {
29
- "uid": "d939-22",
29
+ "uid": "75ce-22",
30
30
  "name": "createQuery.tsx"
31
31
  },
32
32
  {
33
- "uid": "d939-24",
33
+ "uid": "75ce-24",
34
34
  "name": "index.ts"
35
35
  }
36
36
  ]
@@ -41,173 +41,173 @@
41
41
  "isRoot": true
42
42
  },
43
43
  "nodeParts": {
44
- "d939-14": {
44
+ "75ce-14": {
45
45
  "renderedLength": 1201,
46
46
  "gzipLength": 427,
47
47
  "brotliLength": 0,
48
- "mainUid": "d939-13"
48
+ "mainUid": "75ce-13"
49
49
  },
50
- "d939-16": {
50
+ "75ce-16": {
51
51
  "renderedLength": 292,
52
52
  "gzipLength": 169,
53
53
  "brotliLength": 0,
54
- "mainUid": "d939-15"
54
+ "mainUid": "75ce-15"
55
55
  },
56
- "d939-18": {
56
+ "75ce-18": {
57
57
  "renderedLength": 177,
58
58
  "gzipLength": 131,
59
59
  "brotliLength": 0,
60
- "mainUid": "d939-17"
60
+ "mainUid": "75ce-17"
61
61
  },
62
- "d939-20": {
62
+ "75ce-20": {
63
63
  "renderedLength": 457,
64
64
  "gzipLength": 211,
65
65
  "brotliLength": 0,
66
- "mainUid": "d939-19"
66
+ "mainUid": "75ce-19"
67
67
  },
68
- "d939-22": {
68
+ "75ce-22": {
69
69
  "renderedLength": 161,
70
70
  "gzipLength": 121,
71
71
  "brotliLength": 0,
72
- "mainUid": "d939-21"
72
+ "mainUid": "75ce-21"
73
73
  },
74
- "d939-24": {
74
+ "75ce-24": {
75
75
  "renderedLength": 0,
76
76
  "gzipLength": 0,
77
77
  "brotliLength": 0,
78
- "mainUid": "d939-23"
78
+ "mainUid": "75ce-23"
79
79
  }
80
80
  },
81
81
  "nodeMetas": {
82
- "d939-13": {
82
+ "75ce-13": {
83
83
  "id": "/src/createBaseQuery.ts",
84
84
  "moduleParts": {
85
- "index.production.js": "d939-14"
85
+ "index.production.js": "75ce-14"
86
86
  },
87
87
  "imported": [
88
88
  {
89
- "uid": "d939-25"
89
+ "uid": "75ce-25"
90
90
  }
91
91
  ],
92
92
  "importedBy": [
93
93
  {
94
- "uid": "d939-17"
94
+ "uid": "75ce-17"
95
95
  },
96
96
  {
97
- "uid": "d939-21"
97
+ "uid": "75ce-21"
98
98
  }
99
99
  ]
100
100
  },
101
- "d939-15": {
101
+ "75ce-15": {
102
102
  "id": "/src/utils.ts",
103
103
  "moduleParts": {
104
- "index.production.js": "d939-16"
104
+ "index.production.js": "75ce-16"
105
105
  },
106
106
  "imported": [],
107
107
  "importedBy": [
108
108
  {
109
- "uid": "d939-17"
109
+ "uid": "75ce-17"
110
110
  },
111
111
  {
112
- "uid": "d939-21"
112
+ "uid": "75ce-21"
113
113
  }
114
114
  ]
115
115
  },
116
- "d939-17": {
116
+ "75ce-17": {
117
117
  "id": "/src/createInfiniteQuery.ts",
118
118
  "moduleParts": {
119
- "index.production.js": "d939-18"
119
+ "index.production.js": "75ce-18"
120
120
  },
121
121
  "imported": [
122
122
  {
123
- "uid": "d939-25"
123
+ "uid": "75ce-25"
124
124
  },
125
125
  {
126
- "uid": "d939-13"
126
+ "uid": "75ce-13"
127
127
  },
128
128
  {
129
- "uid": "d939-15"
129
+ "uid": "75ce-15"
130
130
  }
131
131
  ],
132
132
  "importedBy": [
133
133
  {
134
- "uid": "d939-23"
134
+ "uid": "75ce-23"
135
135
  }
136
136
  ]
137
137
  },
138
- "d939-19": {
138
+ "75ce-19": {
139
139
  "id": "/src/createMutation.ts",
140
140
  "moduleParts": {
141
- "index.production.js": "d939-20"
141
+ "index.production.js": "75ce-20"
142
142
  },
143
143
  "imported": [
144
144
  {
145
- "uid": "d939-25"
145
+ "uid": "75ce-25"
146
146
  }
147
147
  ],
148
148
  "importedBy": [
149
149
  {
150
- "uid": "d939-23"
150
+ "uid": "75ce-23"
151
151
  }
152
152
  ]
153
153
  },
154
- "d939-21": {
154
+ "75ce-21": {
155
155
  "id": "/src/createQuery.tsx",
156
156
  "moduleParts": {
157
- "index.production.js": "d939-22"
157
+ "index.production.js": "75ce-22"
158
158
  },
159
159
  "imported": [
160
160
  {
161
- "uid": "d939-25"
161
+ "uid": "75ce-25"
162
162
  },
163
163
  {
164
- "uid": "d939-13"
164
+ "uid": "75ce-13"
165
165
  },
166
166
  {
167
- "uid": "d939-15"
167
+ "uid": "75ce-15"
168
168
  }
169
169
  ],
170
170
  "importedBy": [
171
171
  {
172
- "uid": "d939-23"
172
+ "uid": "75ce-23"
173
173
  }
174
174
  ]
175
175
  },
176
- "d939-23": {
176
+ "75ce-23": {
177
177
  "id": "/src/index.ts",
178
178
  "moduleParts": {
179
- "index.production.js": "d939-24"
179
+ "index.production.js": "75ce-24"
180
180
  },
181
181
  "imported": [
182
182
  {
183
- "uid": "d939-17"
183
+ "uid": "75ce-17"
184
184
  },
185
185
  {
186
- "uid": "d939-19"
186
+ "uid": "75ce-19"
187
187
  },
188
188
  {
189
- "uid": "d939-21"
189
+ "uid": "75ce-21"
190
190
  }
191
191
  ],
192
192
  "importedBy": [],
193
193
  "isEntry": true
194
194
  },
195
- "d939-25": {
195
+ "75ce-25": {
196
196
  "id": "@tanstack/react-query",
197
197
  "moduleParts": {},
198
198
  "imported": [],
199
199
  "importedBy": [
200
200
  {
201
- "uid": "d939-17"
201
+ "uid": "75ce-17"
202
202
  },
203
203
  {
204
- "uid": "d939-19"
204
+ "uid": "75ce-19"
205
205
  },
206
206
  {
207
- "uid": "d939-21"
207
+ "uid": "75ce-21"
208
208
  },
209
209
  {
210
- "uid": "d939-13"
210
+ "uid": "75ce-13"
211
211
  }
212
212
  ],
213
213
  "isExternal": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-query-kit",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "🕊️ A toolkit for ReactQuery that make ReactQuery hooks more reusable and typesafe",
5
5
  "author": "liaoliao666",
6
6
  "repository": "liaoliao666/react-query-kit",