@tanstack/query-core 4.24.10 → 5.0.0-alpha.0
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/build/lib/focusManager.d.ts +1 -3
- package/build/lib/focusManager.esm.js +19 -36
- package/build/lib/focusManager.esm.js.map +1 -1
- package/build/lib/focusManager.js +19 -38
- package/build/lib/focusManager.js.map +1 -1
- package/build/lib/focusManager.mjs +19 -36
- package/build/lib/focusManager.mjs.map +1 -1
- package/build/lib/hydration.esm.js +21 -23
- package/build/lib/hydration.esm.js.map +1 -1
- package/build/lib/hydration.js +21 -25
- package/build/lib/hydration.js.map +1 -1
- package/build/lib/hydration.mjs +21 -23
- package/build/lib/hydration.mjs.map +1 -1
- package/build/lib/index.d.ts +1 -2
- package/build/lib/index.esm.js +1 -1
- package/build/lib/index.js +2 -8
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +1 -1
- package/build/lib/infiniteQueryBehavior.d.ts +3 -7
- package/build/lib/infiniteQueryBehavior.esm.js +52 -75
- package/build/lib/infiniteQueryBehavior.esm.js.map +1 -1
- package/build/lib/infiniteQueryBehavior.js +50 -77
- package/build/lib/infiniteQueryBehavior.js.map +1 -1
- package/build/lib/infiniteQueryBehavior.mjs +52 -75
- package/build/lib/infiniteQueryBehavior.mjs.map +1 -1
- package/build/lib/infiniteQueryObserver.d.ts +4 -4
- package/build/lib/infiniteQueryObserver.esm.js +18 -26
- package/build/lib/infiniteQueryObserver.esm.js.map +1 -1
- package/build/lib/infiniteQueryObserver.js +18 -28
- package/build/lib/infiniteQueryObserver.js.map +1 -1
- package/build/lib/infiniteQueryObserver.mjs +18 -26
- package/build/lib/infiniteQueryObserver.mjs.map +1 -1
- package/build/lib/mutation.d.ts +11 -22
- package/build/lib/mutation.esm.js +73 -105
- package/build/lib/mutation.esm.js.map +1 -1
- package/build/lib/mutation.js +73 -107
- package/build/lib/mutation.js.map +1 -1
- package/build/lib/mutation.mjs +73 -105
- package/build/lib/mutation.mjs.map +1 -1
- package/build/lib/mutationCache.d.ts +4 -6
- package/build/lib/mutationCache.esm.js +23 -32
- package/build/lib/mutationCache.esm.js.map +1 -1
- package/build/lib/mutationCache.js +23 -34
- package/build/lib/mutationCache.js.map +1 -1
- package/build/lib/mutationCache.mjs +23 -32
- package/build/lib/mutationCache.mjs.map +1 -1
- package/build/lib/mutationObserver.d.ts +4 -9
- package/build/lib/mutationObserver.esm.js +43 -72
- package/build/lib/mutationObserver.esm.js.map +1 -1
- package/build/lib/mutationObserver.js +43 -74
- package/build/lib/mutationObserver.js.map +1 -1
- package/build/lib/mutationObserver.mjs +43 -72
- package/build/lib/mutationObserver.mjs.map +1 -1
- package/build/lib/notifyManager.esm.js +7 -17
- package/build/lib/notifyManager.esm.js.map +1 -1
- package/build/lib/notifyManager.js +7 -19
- package/build/lib/notifyManager.js.map +1 -1
- package/build/lib/notifyManager.mjs +7 -17
- package/build/lib/notifyManager.mjs.map +1 -1
- package/build/lib/onlineManager.d.ts +1 -3
- package/build/lib/onlineManager.esm.js +16 -30
- package/build/lib/onlineManager.esm.js.map +1 -1
- package/build/lib/onlineManager.js +16 -32
- package/build/lib/onlineManager.js.map +1 -1
- package/build/lib/onlineManager.mjs +16 -30
- package/build/lib/onlineManager.mjs.map +1 -1
- package/build/lib/queriesObserver.d.ts +3 -10
- package/build/lib/queriesObserver.esm.js +47 -71
- package/build/lib/queriesObserver.esm.js.map +1 -1
- package/build/lib/queriesObserver.js +49 -75
- package/build/lib/queriesObserver.js.map +1 -1
- package/build/lib/queriesObserver.mjs +47 -71
- package/build/lib/queriesObserver.mjs.map +1 -1
- package/build/lib/query.d.ts +14 -21
- package/build/lib/query.esm.js +140 -194
- package/build/lib/query.esm.js.map +1 -1
- package/build/lib/query.js +139 -195
- package/build/lib/query.js.map +1 -1
- package/build/lib/query.mjs +140 -194
- package/build/lib/query.mjs.map +1 -1
- package/build/lib/queryCache.d.ts +12 -7
- package/build/lib/queryCache.esm.js +21 -45
- package/build/lib/queryCache.esm.js.map +1 -1
- package/build/lib/queryCache.js +20 -46
- package/build/lib/queryCache.js.map +1 -1
- package/build/lib/queryCache.mjs +21 -45
- package/build/lib/queryCache.mjs.map +1 -1
- package/build/lib/queryClient.d.ts +18 -46
- package/build/lib/queryClient.esm.js +137 -216
- package/build/lib/queryClient.esm.js.map +1 -1
- package/build/lib/queryClient.js +136 -217
- package/build/lib/queryClient.js.map +1 -1
- package/build/lib/queryClient.mjs +137 -216
- package/build/lib/queryClient.mjs.map +1 -1
- package/build/lib/queryObserver.d.ts +4 -29
- package/build/lib/queryObserver.esm.js +176 -258
- package/build/lib/queryObserver.esm.js.map +1 -1
- package/build/lib/queryObserver.js +176 -260
- package/build/lib/queryObserver.js.map +1 -1
- package/build/lib/queryObserver.mjs +176 -258
- package/build/lib/queryObserver.mjs.map +1 -1
- package/build/lib/removable.d.ts +3 -3
- package/build/lib/removable.esm.js +10 -14
- package/build/lib/removable.esm.js.map +1 -1
- package/build/lib/removable.js +10 -16
- package/build/lib/removable.js.map +1 -1
- package/build/lib/removable.mjs +10 -14
- package/build/lib/removable.mjs.map +1 -1
- package/build/lib/retryer.d.ts +5 -5
- package/build/lib/retryer.esm.js +27 -44
- package/build/lib/retryer.esm.js.map +1 -1
- package/build/lib/retryer.js +27 -46
- package/build/lib/retryer.js.map +1 -1
- package/build/lib/retryer.mjs +27 -44
- package/build/lib/retryer.mjs.map +1 -1
- package/build/lib/subscribable.esm.js +4 -7
- package/build/lib/subscribable.esm.js.map +1 -1
- package/build/lib/subscribable.js +4 -9
- package/build/lib/subscribable.js.map +1 -1
- package/build/lib/subscribable.mjs +4 -7
- package/build/lib/subscribable.mjs.map +1 -1
- package/build/lib/tests/utils.d.ts +3 -12
- package/build/lib/types.d.ts +111 -99
- package/build/lib/utils.d.ts +8 -18
- package/build/lib/utils.esm.js +39 -132
- package/build/lib/utils.esm.js.map +1 -1
- package/build/lib/utils.js +42 -144
- package/build/lib/utils.js.map +1 -1
- package/build/lib/utils.mjs +39 -132
- package/build/lib/utils.mjs.map +1 -1
- package/build/umd/index.development.js +868 -1398
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/focusManager.ts +17 -24
- package/src/index.ts +1 -11
- package/src/infiniteQueryBehavior.ts +54 -94
- package/src/infiniteQueryObserver.ts +10 -12
- package/src/mutation.ts +68 -92
- package/src/mutationCache.ts +27 -27
- package/src/mutationObserver.ts +60 -97
- package/src/onlineManager.ts +14 -14
- package/src/queriesObserver.ts +50 -54
- package/src/query.ts +106 -110
- package/src/queryCache.ts +42 -41
- package/src/queryClient.ts +155 -434
- package/src/queryObserver.ts +155 -192
- package/src/removable.ts +13 -13
- package/src/retryer.ts +5 -5
- package/src/tests/focusManager.test.tsx +25 -25
- package/src/tests/hydration.test.tsx +167 -81
- package/src/tests/infiniteQueryBehavior.test.tsx +209 -17
- package/src/tests/infiniteQueryObserver.test.tsx +6 -2
- package/src/tests/mutationCache.test.tsx +127 -127
- package/src/tests/mutationObserver.test.tsx +1 -31
- package/src/tests/mutations.test.tsx +62 -43
- package/src/tests/onlineManager.test.tsx +12 -4
- package/src/tests/queriesObserver.test.tsx +41 -77
- package/src/tests/query.test.tsx +175 -243
- package/src/tests/queryCache.test.tsx +170 -93
- package/src/tests/queryClient.test.tsx +229 -378
- package/src/tests/queryObserver.test.tsx +23 -147
- package/src/tests/utils.test.tsx +84 -29
- package/src/tests/utils.ts +9 -18
- package/src/types.ts +187 -140
- package/src/utils.ts +31 -124
- package/build/lib/logger.d.ts +0 -8
- package/build/lib/logger.esm.js +0 -4
- package/build/lib/logger.esm.js.map +0 -1
- package/build/lib/logger.js +0 -8
- package/build/lib/logger.js.map +0 -1
- package/build/lib/logger.mjs +0 -4
- package/build/lib/logger.mjs.map +0 -1
- package/build/lib/logger.native.d.ts +0 -6
- package/build/lib/logger.native.esm.js +0 -12
- package/build/lib/logger.native.esm.js.map +0 -1
- package/build/lib/logger.native.js +0 -16
- package/build/lib/logger.native.js.map +0 -1
- package/build/lib/logger.native.mjs +0 -12
- package/build/lib/logger.native.mjs.map +0 -1
- package/src/logger.native.ts +0 -11
- 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
|
-
|
|
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
|
-
*
|
|
54
|
+
* Filter by mutation status
|
|
57
55
|
*/
|
|
58
|
-
|
|
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 (
|
|
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,
|
|
228
|
-
if (
|
|
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 ||
|
|
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
|
|
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
|
-
|
|
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) => !
|
|
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
|
-
|
|
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
|
+
}
|
package/build/lib/logger.d.ts
DELETED
package/build/lib/logger.esm.js
DELETED
|
@@ -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;;;;"}
|
package/build/lib/logger.js
DELETED
package/build/lib/logger.js.map
DELETED
|
@@ -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;;;;"}
|
package/build/lib/logger.mjs
DELETED
package/build/lib/logger.mjs.map
DELETED
|
@@ -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,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;;;;"}
|
package/src/logger.native.ts
DELETED
|
@@ -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
|
-
}
|