@tanstack/query-core 4.24.10 → 5.0.0-alpha.1

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.
Files changed (184) hide show
  1. package/build/lib/focusManager.d.ts +1 -3
  2. package/build/lib/focusManager.esm.js +19 -36
  3. package/build/lib/focusManager.esm.js.map +1 -1
  4. package/build/lib/focusManager.js +19 -38
  5. package/build/lib/focusManager.js.map +1 -1
  6. package/build/lib/focusManager.mjs +19 -36
  7. package/build/lib/focusManager.mjs.map +1 -1
  8. package/build/lib/hydration.esm.js +21 -23
  9. package/build/lib/hydration.esm.js.map +1 -1
  10. package/build/lib/hydration.js +21 -25
  11. package/build/lib/hydration.js.map +1 -1
  12. package/build/lib/hydration.mjs +21 -23
  13. package/build/lib/hydration.mjs.map +1 -1
  14. package/build/lib/index.d.ts +1 -2
  15. package/build/lib/index.esm.js +1 -1
  16. package/build/lib/index.js +2 -8
  17. package/build/lib/index.js.map +1 -1
  18. package/build/lib/index.mjs +1 -1
  19. package/build/lib/infiniteQueryBehavior.d.ts +3 -7
  20. package/build/lib/infiniteQueryBehavior.esm.js +52 -75
  21. package/build/lib/infiniteQueryBehavior.esm.js.map +1 -1
  22. package/build/lib/infiniteQueryBehavior.js +50 -77
  23. package/build/lib/infiniteQueryBehavior.js.map +1 -1
  24. package/build/lib/infiniteQueryBehavior.mjs +52 -75
  25. package/build/lib/infiniteQueryBehavior.mjs.map +1 -1
  26. package/build/lib/infiniteQueryObserver.d.ts +4 -4
  27. package/build/lib/infiniteQueryObserver.esm.js +18 -26
  28. package/build/lib/infiniteQueryObserver.esm.js.map +1 -1
  29. package/build/lib/infiniteQueryObserver.js +18 -28
  30. package/build/lib/infiniteQueryObserver.js.map +1 -1
  31. package/build/lib/infiniteQueryObserver.mjs +18 -26
  32. package/build/lib/infiniteQueryObserver.mjs.map +1 -1
  33. package/build/lib/mutation.d.ts +11 -22
  34. package/build/lib/mutation.esm.js +73 -105
  35. package/build/lib/mutation.esm.js.map +1 -1
  36. package/build/lib/mutation.js +73 -107
  37. package/build/lib/mutation.js.map +1 -1
  38. package/build/lib/mutation.mjs +73 -105
  39. package/build/lib/mutation.mjs.map +1 -1
  40. package/build/lib/mutationCache.d.ts +4 -6
  41. package/build/lib/mutationCache.esm.js +23 -32
  42. package/build/lib/mutationCache.esm.js.map +1 -1
  43. package/build/lib/mutationCache.js +23 -34
  44. package/build/lib/mutationCache.js.map +1 -1
  45. package/build/lib/mutationCache.mjs +23 -32
  46. package/build/lib/mutationCache.mjs.map +1 -1
  47. package/build/lib/mutationObserver.d.ts +4 -9
  48. package/build/lib/mutationObserver.esm.js +42 -73
  49. package/build/lib/mutationObserver.esm.js.map +1 -1
  50. package/build/lib/mutationObserver.js +42 -75
  51. package/build/lib/mutationObserver.js.map +1 -1
  52. package/build/lib/mutationObserver.mjs +42 -73
  53. package/build/lib/mutationObserver.mjs.map +1 -1
  54. package/build/lib/notifyManager.esm.js +7 -17
  55. package/build/lib/notifyManager.esm.js.map +1 -1
  56. package/build/lib/notifyManager.js +7 -19
  57. package/build/lib/notifyManager.js.map +1 -1
  58. package/build/lib/notifyManager.mjs +7 -17
  59. package/build/lib/notifyManager.mjs.map +1 -1
  60. package/build/lib/onlineManager.d.ts +1 -3
  61. package/build/lib/onlineManager.esm.js +16 -30
  62. package/build/lib/onlineManager.esm.js.map +1 -1
  63. package/build/lib/onlineManager.js +16 -32
  64. package/build/lib/onlineManager.js.map +1 -1
  65. package/build/lib/onlineManager.mjs +16 -30
  66. package/build/lib/onlineManager.mjs.map +1 -1
  67. package/build/lib/queriesObserver.d.ts +3 -10
  68. package/build/lib/queriesObserver.esm.js +47 -71
  69. package/build/lib/queriesObserver.esm.js.map +1 -1
  70. package/build/lib/queriesObserver.js +49 -75
  71. package/build/lib/queriesObserver.js.map +1 -1
  72. package/build/lib/queriesObserver.mjs +47 -71
  73. package/build/lib/queriesObserver.mjs.map +1 -1
  74. package/build/lib/query.d.ts +14 -21
  75. package/build/lib/query.esm.js +140 -194
  76. package/build/lib/query.esm.js.map +1 -1
  77. package/build/lib/query.js +139 -195
  78. package/build/lib/query.js.map +1 -1
  79. package/build/lib/query.mjs +140 -194
  80. package/build/lib/query.mjs.map +1 -1
  81. package/build/lib/queryCache.d.ts +12 -7
  82. package/build/lib/queryCache.esm.js +21 -45
  83. package/build/lib/queryCache.esm.js.map +1 -1
  84. package/build/lib/queryCache.js +20 -46
  85. package/build/lib/queryCache.js.map +1 -1
  86. package/build/lib/queryCache.mjs +21 -45
  87. package/build/lib/queryCache.mjs.map +1 -1
  88. package/build/lib/queryClient.d.ts +18 -46
  89. package/build/lib/queryClient.esm.js +137 -216
  90. package/build/lib/queryClient.esm.js.map +1 -1
  91. package/build/lib/queryClient.js +136 -217
  92. package/build/lib/queryClient.js.map +1 -1
  93. package/build/lib/queryClient.mjs +137 -216
  94. package/build/lib/queryClient.mjs.map +1 -1
  95. package/build/lib/queryObserver.d.ts +4 -29
  96. package/build/lib/queryObserver.esm.js +176 -258
  97. package/build/lib/queryObserver.esm.js.map +1 -1
  98. package/build/lib/queryObserver.js +176 -260
  99. package/build/lib/queryObserver.js.map +1 -1
  100. package/build/lib/queryObserver.mjs +176 -258
  101. package/build/lib/queryObserver.mjs.map +1 -1
  102. package/build/lib/removable.d.ts +3 -3
  103. package/build/lib/removable.esm.js +10 -14
  104. package/build/lib/removable.esm.js.map +1 -1
  105. package/build/lib/removable.js +10 -16
  106. package/build/lib/removable.js.map +1 -1
  107. package/build/lib/removable.mjs +10 -14
  108. package/build/lib/removable.mjs.map +1 -1
  109. package/build/lib/retryer.d.ts +5 -5
  110. package/build/lib/retryer.esm.js +27 -44
  111. package/build/lib/retryer.esm.js.map +1 -1
  112. package/build/lib/retryer.js +27 -46
  113. package/build/lib/retryer.js.map +1 -1
  114. package/build/lib/retryer.mjs +27 -44
  115. package/build/lib/retryer.mjs.map +1 -1
  116. package/build/lib/subscribable.esm.js +4 -7
  117. package/build/lib/subscribable.esm.js.map +1 -1
  118. package/build/lib/subscribable.js +4 -9
  119. package/build/lib/subscribable.js.map +1 -1
  120. package/build/lib/subscribable.mjs +4 -7
  121. package/build/lib/subscribable.mjs.map +1 -1
  122. package/build/lib/tests/utils.d.ts +3 -12
  123. package/build/lib/types.d.ts +111 -99
  124. package/build/lib/utils.d.ts +8 -18
  125. package/build/lib/utils.esm.js +39 -132
  126. package/build/lib/utils.esm.js.map +1 -1
  127. package/build/lib/utils.js +42 -144
  128. package/build/lib/utils.js.map +1 -1
  129. package/build/lib/utils.mjs +39 -132
  130. package/build/lib/utils.mjs.map +1 -1
  131. package/build/umd/index.development.js +867 -1399
  132. package/build/umd/index.development.js.map +1 -1
  133. package/build/umd/index.production.js +1 -1
  134. package/build/umd/index.production.js.map +1 -1
  135. package/package.json +1 -1
  136. package/src/focusManager.ts +17 -24
  137. package/src/index.ts +1 -11
  138. package/src/infiniteQueryBehavior.ts +54 -94
  139. package/src/infiniteQueryObserver.ts +10 -12
  140. package/src/mutation.ts +68 -92
  141. package/src/mutationCache.ts +27 -27
  142. package/src/mutationObserver.ts +58 -97
  143. package/src/onlineManager.ts +14 -14
  144. package/src/queriesObserver.ts +50 -54
  145. package/src/query.ts +107 -111
  146. package/src/queryCache.ts +42 -41
  147. package/src/queryClient.ts +155 -434
  148. package/src/queryObserver.ts +155 -192
  149. package/src/removable.ts +13 -13
  150. package/src/retryer.ts +5 -5
  151. package/src/subscribable.ts +1 -1
  152. package/src/tests/focusManager.test.tsx +25 -25
  153. package/src/tests/hydration.test.tsx +167 -81
  154. package/src/tests/infiniteQueryBehavior.test.tsx +209 -17
  155. package/src/tests/infiniteQueryObserver.test.tsx +6 -2
  156. package/src/tests/mutationCache.test.tsx +127 -127
  157. package/src/tests/mutationObserver.test.tsx +1 -31
  158. package/src/tests/mutations.test.tsx +62 -43
  159. package/src/tests/onlineManager.test.tsx +12 -4
  160. package/src/tests/queriesObserver.test.tsx +41 -77
  161. package/src/tests/query.test.tsx +175 -243
  162. package/src/tests/queryCache.test.tsx +170 -93
  163. package/src/tests/queryClient.test.tsx +229 -378
  164. package/src/tests/queryObserver.test.tsx +23 -147
  165. package/src/tests/utils.test.tsx +84 -29
  166. package/src/tests/utils.ts +9 -18
  167. package/src/types.ts +187 -140
  168. package/src/utils.ts +31 -124
  169. package/build/lib/logger.d.ts +0 -8
  170. package/build/lib/logger.esm.js +0 -4
  171. package/build/lib/logger.esm.js.map +0 -1
  172. package/build/lib/logger.js +0 -8
  173. package/build/lib/logger.js.map +0 -1
  174. package/build/lib/logger.mjs +0 -4
  175. package/build/lib/logger.mjs.map +0 -1
  176. package/build/lib/logger.native.d.ts +0 -6
  177. package/build/lib/logger.native.esm.js +0 -12
  178. package/build/lib/logger.native.esm.js.map +0 -1
  179. package/build/lib/logger.native.js +0 -16
  180. package/build/lib/logger.native.js.map +0 -1
  181. package/build/lib/logger.native.mjs +0 -12
  182. package/build/lib/logger.native.mjs.map +0 -1
  183. package/src/logger.native.ts +0 -11
  184. package/src/logger.ts +0 -9
package/src/utils.ts CHANGED
@@ -2,10 +2,8 @@ import type { Mutation } from './mutation'
2
2
  import type { Query } from './query'
3
3
  import type {
4
4
  FetchStatus,
5
- MutationFunction,
6
5
  MutationKey,
7
- MutationOptions,
8
- QueryFunction,
6
+ MutationStatus,
9
7
  QueryKey,
10
8
  QueryOptions,
11
9
  } from './types'
@@ -53,9 +51,9 @@ export interface MutationFilters {
53
51
  */
54
52
  mutationKey?: MutationKey
55
53
  /**
56
- * Include or exclude fetching mutations
54
+ * Filter by mutation status
57
55
  */
58
- fetching?: boolean
56
+ status?: MutationStatus
59
57
  }
60
58
 
61
59
  export type DataUpdateFunction<TInput, TOutput> = (input: TInput) => TOutput
@@ -87,88 +85,10 @@ export function isValidTimeout(value: unknown): value is number {
87
85
  return typeof value === 'number' && value >= 0 && value !== Infinity
88
86
  }
89
87
 
90
- export function difference<T>(array1: T[], array2: T[]): T[] {
91
- return array1.filter((x) => array2.indexOf(x) === -1)
92
- }
93
-
94
- export function replaceAt<T>(array: T[], index: number, value: T): T[] {
95
- const copy = array.slice(0)
96
- copy[index] = value
97
- return copy
98
- }
99
-
100
88
  export function timeUntilStale(updatedAt: number, staleTime?: number): number {
101
89
  return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)
102
90
  }
103
91
 
104
- export function parseQueryArgs<
105
- TOptions extends QueryOptions<any, any, any, TQueryKey>,
106
- TQueryKey extends QueryKey = QueryKey,
107
- >(
108
- arg1: TQueryKey | TOptions,
109
- arg2?: QueryFunction<any, TQueryKey> | TOptions,
110
- arg3?: TOptions,
111
- ): TOptions {
112
- if (!isQueryKey(arg1)) {
113
- return arg1 as TOptions
114
- }
115
-
116
- if (typeof arg2 === 'function') {
117
- return { ...arg3, queryKey: arg1, queryFn: arg2 } as TOptions
118
- }
119
-
120
- return { ...arg2, queryKey: arg1 } as TOptions
121
- }
122
-
123
- export function parseMutationArgs<
124
- TOptions extends MutationOptions<any, any, any, any>,
125
- >(
126
- arg1: MutationKey | MutationFunction<any, any> | TOptions,
127
- arg2?: MutationFunction<any, any> | TOptions,
128
- arg3?: TOptions,
129
- ): TOptions {
130
- if (isQueryKey(arg1)) {
131
- if (typeof arg2 === 'function') {
132
- return { ...arg3, mutationKey: arg1, mutationFn: arg2 } as TOptions
133
- }
134
- return { ...arg2, mutationKey: arg1 } as TOptions
135
- }
136
-
137
- if (typeof arg1 === 'function') {
138
- return { ...arg2, mutationFn: arg1 } as TOptions
139
- }
140
-
141
- return { ...arg1 } as TOptions
142
- }
143
-
144
- export function parseFilterArgs<
145
- TFilters extends QueryFilters,
146
- TOptions = unknown,
147
- >(
148
- arg1?: QueryKey | TFilters,
149
- arg2?: TFilters | TOptions,
150
- arg3?: TOptions,
151
- ): [TFilters, TOptions | undefined] {
152
- return (
153
- isQueryKey(arg1) ? [{ ...arg2, queryKey: arg1 }, arg3] : [arg1 || {}, arg2]
154
- ) as [TFilters, TOptions]
155
- }
156
-
157
- export function parseMutationFilterArgs<
158
- TFilters extends MutationFilters,
159
- TOptions = unknown,
160
- >(
161
- arg1?: QueryKey | TFilters,
162
- arg2?: TFilters | TOptions,
163
- arg3?: TOptions,
164
- ): [TFilters, TOptions | undefined] {
165
- return (
166
- isQueryKey(arg1)
167
- ? [{ ...arg2, mutationKey: arg1 }, arg3]
168
- : [arg1 || {}, arg2]
169
- ) as [TFilters, TOptions]
170
- }
171
-
172
92
  export function matchQuery(
173
93
  filters: QueryFilters,
174
94
  query: Query<any, any, any, any>,
@@ -182,7 +102,7 @@ export function matchQuery(
182
102
  stale,
183
103
  } = filters
184
104
 
185
- if (isQueryKey(queryKey)) {
105
+ if (queryKey) {
186
106
  if (exact) {
187
107
  if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {
188
108
  return false
@@ -224,15 +144,13 @@ export function matchMutation(
224
144
  filters: MutationFilters,
225
145
  mutation: Mutation<any, any>,
226
146
  ): boolean {
227
- const { exact, fetching, predicate, mutationKey } = filters
228
- if (isQueryKey(mutationKey)) {
147
+ const { exact, status, predicate, mutationKey } = filters
148
+ if (mutationKey) {
229
149
  if (!mutation.options.mutationKey) {
230
150
  return false
231
151
  }
232
152
  if (exact) {
233
- if (
234
- hashQueryKey(mutation.options.mutationKey) !== hashQueryKey(mutationKey)
235
- ) {
153
+ if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {
236
154
  return false
237
155
  }
238
156
  } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {
@@ -240,10 +158,7 @@ export function matchMutation(
240
158
  }
241
159
  }
242
160
 
243
- if (
244
- typeof fetching === 'boolean' &&
245
- (mutation.state.status === 'loading') !== fetching
246
- ) {
161
+ if (status && mutation.state.status !== status) {
247
162
  return false
248
163
  }
249
164
 
@@ -258,15 +173,15 @@ export function hashQueryKeyByOptions<TQueryKey extends QueryKey = QueryKey>(
258
173
  queryKey: TQueryKey,
259
174
  options?: QueryOptions<any, any, any, TQueryKey>,
260
175
  ): string {
261
- const hashFn = options?.queryKeyHashFn || hashQueryKey
176
+ const hashFn = options?.queryKeyHashFn || hashKey
262
177
  return hashFn(queryKey)
263
178
  }
264
179
 
265
180
  /**
266
- * Default query keys hash function.
181
+ * Default query & mutation keys hash function.
267
182
  * Hashes the value into a stable hash.
268
183
  */
269
- export function hashQueryKey(queryKey: QueryKey): string {
184
+ export function hashKey(queryKey: QueryKey | MutationKey): string {
270
185
  return JSON.stringify(queryKey, (_, val) =>
271
186
  isPlainObject(val)
272
187
  ? Object.keys(val)
@@ -282,14 +197,8 @@ export function hashQueryKey(queryKey: QueryKey): string {
282
197
  /**
283
198
  * Checks if key `b` partially matches with key `a`.
284
199
  */
285
- export function partialMatchKey(a: QueryKey, b: QueryKey): boolean {
286
- return partialDeepEqual(a, b)
287
- }
288
-
289
- /**
290
- * Checks if `b` partially matches with `a`.
291
- */
292
- export function partialDeepEqual(a: any, b: any): boolean {
200
+ export function partialMatchKey(a: QueryKey, b: QueryKey): boolean
201
+ export function partialMatchKey(a: any, b: any): boolean {
293
202
  if (a === b) {
294
203
  return true
295
204
  }
@@ -299,7 +208,7 @@ export function partialDeepEqual(a: any, b: any): boolean {
299
208
  }
300
209
 
301
210
  if (a && b && typeof a === 'object' && typeof b === 'object') {
302
- return !Object.keys(b).some((key) => !partialDeepEqual(a[key], b[key]))
211
+ return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key]))
303
212
  }
304
213
 
305
214
  return false
@@ -392,14 +301,6 @@ function hasObjectPrototype(o: any): boolean {
392
301
  return Object.prototype.toString.call(o) === '[object Object]'
393
302
  }
394
303
 
395
- export function isQueryKey(value: unknown): value is QueryKey {
396
- return Array.isArray(value)
397
- }
398
-
399
- export function isError(value: any): value is Error {
400
- return value instanceof Error
401
- }
402
-
403
304
  export function sleep(timeout: number): Promise<void> {
404
305
  return new Promise((resolve) => {
405
306
  setTimeout(resolve, timeout)
@@ -414,21 +315,11 @@ export function scheduleMicrotask(callback: () => void) {
414
315
  sleep(0).then(callback)
415
316
  }
416
317
 
417
- export function getAbortController(): AbortController | undefined {
418
- if (typeof AbortController === 'function') {
419
- return new AbortController()
420
- }
421
- return
422
- }
423
-
424
318
  export function replaceData<
425
319
  TData,
426
320
  TOptions extends QueryOptions<any, any, any, any>,
427
321
  >(prevData: TData | undefined, data: TData, options: TOptions): TData {
428
- // Use prev data if an isDataEqual function is defined and returns `true`
429
- if (options.isDataEqual?.(prevData, data)) {
430
- return prevData as TData
431
- } else if (typeof options.structuralSharing === 'function') {
322
+ if (typeof options.structuralSharing === 'function') {
432
323
  return options.structuralSharing(prevData, data)
433
324
  } else if (options.structuralSharing !== false) {
434
325
  // Structurally share data between prev and new data if needed
@@ -436,3 +327,19 @@ export function replaceData<
436
327
  }
437
328
  return data
438
329
  }
330
+
331
+ export function keepPreviousData<T>(
332
+ previousData: T | undefined,
333
+ ): T | undefined {
334
+ return previousData
335
+ }
336
+
337
+ export function addToEnd<T>(items: T[], item: T, max = 0): T[] {
338
+ const newItems = [...items, item]
339
+ return max && newItems.length > max ? newItems.slice(1) : newItems
340
+ }
341
+
342
+ export function addToStart<T>(items: T[], item: T, max = 0): T[] {
343
+ const newItems = [item, ...items]
344
+ return max && newItems.length > max ? newItems.slice(0, -1) : newItems
345
+ }
@@ -1,8 +0,0 @@
1
- export interface Logger {
2
- log: LogFunction;
3
- warn: LogFunction;
4
- error: LogFunction;
5
- }
6
- declare type LogFunction = (...args: any[]) => void;
7
- export declare const defaultLogger: Logger;
8
- export {};
@@ -1,4 +0,0 @@
1
- const defaultLogger = console;
2
-
3
- export { defaultLogger };
4
- //# sourceMappingURL=logger.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.esm.js","sources":["../../src/logger.ts"],"sourcesContent":["export interface Logger {\n log: LogFunction\n warn: LogFunction\n error: LogFunction\n}\n\ntype LogFunction = (...args: any[]) => void\n\nexport const defaultLogger: Logger = console\n"],"names":["defaultLogger","console"],"mappings":"AAQO,MAAMA,aAAqB,GAAGC;;;;"}
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const defaultLogger = console;
6
-
7
- exports.defaultLogger = defaultLogger;
8
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sources":["../../src/logger.ts"],"sourcesContent":["export interface Logger {\n log: LogFunction\n warn: LogFunction\n error: LogFunction\n}\n\ntype LogFunction = (...args: any[]) => void\n\nexport const defaultLogger: Logger = console\n"],"names":["defaultLogger","console"],"mappings":";;;;AAQO,MAAMA,aAAqB,GAAGC;;;;"}
@@ -1,4 +0,0 @@
1
- const defaultLogger = console;
2
-
3
- export { defaultLogger };
4
- //# sourceMappingURL=logger.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.mjs","sources":["../../src/logger.ts"],"sourcesContent":["export interface Logger {\n log: LogFunction\n warn: LogFunction\n error: LogFunction\n}\n\ntype LogFunction = (...args: any[]) => void\n\nexport const defaultLogger: Logger = console\n"],"names":["defaultLogger","console"],"mappings":"AAQO,MAAMA,aAAqB,GAAGC;;;;"}
@@ -1,6 +0,0 @@
1
- import type { Logger } from './logger';
2
- /**
3
- * See https://github.com/tannerlinsley/react-query/issues/795
4
- * and https://github.com/tannerlinsley/react-query/pull/3246/#discussion_r795105707
5
- */
6
- export declare const defaultLogger: Logger;
@@ -1,12 +0,0 @@
1
- /**
2
- * See https://github.com/tannerlinsley/react-query/issues/795
3
- * and https://github.com/tannerlinsley/react-query/pull/3246/#discussion_r795105707
4
- */
5
- const defaultLogger = {
6
- log: console.log,
7
- warn: console.warn,
8
- error: console.warn
9
- };
10
-
11
- export { defaultLogger };
12
- //# sourceMappingURL=logger.native.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.native.esm.js","sources":["../../src/logger.native.ts"],"sourcesContent":["import type { Logger } from './logger'\n\n/**\n * See https://github.com/tannerlinsley/react-query/issues/795\n * and https://github.com/tannerlinsley/react-query/pull/3246/#discussion_r795105707\n */\nexport const defaultLogger: Logger = {\n log: console.log,\n warn: console.warn,\n error: console.warn,\n}\n"],"names":["defaultLogger","log","console","warn","error"],"mappings":"AAEA;AACA;AACA;AACA;AACO,MAAMA,aAAqB,GAAG;EACnCC,GAAG,EAAEC,OAAO,CAACD,GADsB;EAEnCE,IAAI,EAAED,OAAO,CAACC,IAFqB;EAGnCC,KAAK,EAAEF,OAAO,CAACC,IAAAA;AAHoB;;;;"}
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- /**
6
- * See https://github.com/tannerlinsley/react-query/issues/795
7
- * and https://github.com/tannerlinsley/react-query/pull/3246/#discussion_r795105707
8
- */
9
- const defaultLogger = {
10
- log: console.log,
11
- warn: console.warn,
12
- error: console.warn
13
- };
14
-
15
- exports.defaultLogger = defaultLogger;
16
- //# sourceMappingURL=logger.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.native.js","sources":["../../src/logger.native.ts"],"sourcesContent":["import type { Logger } from './logger'\n\n/**\n * See https://github.com/tannerlinsley/react-query/issues/795\n * and https://github.com/tannerlinsley/react-query/pull/3246/#discussion_r795105707\n */\nexport const defaultLogger: Logger = {\n log: console.log,\n warn: console.warn,\n error: console.warn,\n}\n"],"names":["defaultLogger","log","console","warn","error"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACO,MAAMA,aAAqB,GAAG;EACnCC,GAAG,EAAEC,OAAO,CAACD,GADsB;EAEnCE,IAAI,EAAED,OAAO,CAACC,IAFqB;EAGnCC,KAAK,EAAEF,OAAO,CAACC,IAAAA;AAHoB;;;;"}
@@ -1,12 +0,0 @@
1
- /**
2
- * See https://github.com/tannerlinsley/react-query/issues/795
3
- * and https://github.com/tannerlinsley/react-query/pull/3246/#discussion_r795105707
4
- */
5
- const defaultLogger = {
6
- log: console.log,
7
- warn: console.warn,
8
- error: console.warn
9
- };
10
-
11
- export { defaultLogger };
12
- //# sourceMappingURL=logger.native.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.native.mjs","sources":["../../src/logger.native.ts"],"sourcesContent":["import type { Logger } from './logger'\n\n/**\n * See https://github.com/tannerlinsley/react-query/issues/795\n * and https://github.com/tannerlinsley/react-query/pull/3246/#discussion_r795105707\n */\nexport const defaultLogger: Logger = {\n log: console.log,\n warn: console.warn,\n error: console.warn,\n}\n"],"names":["defaultLogger","log","console","warn","error"],"mappings":"AAEA;AACA;AACA;AACA;AACO,MAAMA,aAAqB,GAAG;EACnCC,GAAG,EAAEC,OAAO,CAACD,GADsB;EAEnCE,IAAI,EAAED,OAAO,CAACC,IAFqB;EAGnCC,KAAK,EAAEF,OAAO,CAACC,IAAAA;AAHoB;;;;"}
@@ -1,11 +0,0 @@
1
- import type { Logger } from './logger'
2
-
3
- /**
4
- * See https://github.com/tannerlinsley/react-query/issues/795
5
- * and https://github.com/tannerlinsley/react-query/pull/3246/#discussion_r795105707
6
- */
7
- export const defaultLogger: Logger = {
8
- log: console.log,
9
- warn: console.warn,
10
- error: console.warn,
11
- }
package/src/logger.ts DELETED
@@ -1,9 +0,0 @@
1
- export interface Logger {
2
- log: LogFunction
3
- warn: LogFunction
4
- error: LogFunction
5
- }
6
-
7
- type LogFunction = (...args: any[]) => void
8
-
9
- export const defaultLogger: Logger = console