@tanstack/query-core
Advanced tools
Comparing version 5.60.6 to 5.61.4
@@ -11,3 +11,3 @@ type NotifyCallback = () => void; | ||
*/ | ||
readonly batchCalls: <T_1 extends unknown[]>(callback: BatchCallsCallback<T_1>) => BatchCallsCallback<T_1>; | ||
readonly batchCalls: <T extends Array<unknown>>(callback: BatchCallsCallback<T>) => BatchCallsCallback<T>; | ||
readonly schedule: (callback: NotifyCallback) => void; | ||
@@ -31,3 +31,3 @@ /** | ||
*/ | ||
readonly batchCalls: <T_1 extends unknown[]>(callback: BatchCallsCallback<T_1>) => BatchCallsCallback<T_1>; | ||
readonly batchCalls: <T extends Array<unknown>>(callback: BatchCallsCallback<T>) => BatchCallsCallback<T>; | ||
readonly schedule: (callback: NotifyCallback) => void; | ||
@@ -34,0 +34,0 @@ /** |
@@ -183,18 +183,9 @@ import { | ||
} else { | ||
const existingObserver = __privateGet(this, _observers).find( | ||
(o) => o.options.queryHash === defaultedOptions.queryHash | ||
); | ||
observers.push({ | ||
defaultedQueryOptions: defaultedOptions, | ||
observer: existingObserver ?? new QueryObserver(__privateGet(this, _client), defaultedOptions) | ||
observer: new QueryObserver(__privateGet(this, _client), defaultedOptions) | ||
}); | ||
} | ||
}); | ||
return observers.sort((a, b) => { | ||
return queries.findIndex( | ||
(q) => q.queryHash === a.defaultedQueryOptions.queryHash | ||
) - queries.findIndex( | ||
(q) => q.queryHash === b.defaultedQueryOptions.queryHash | ||
); | ||
}); | ||
return observers; | ||
}; | ||
@@ -201,0 +192,0 @@ _onUpdate = new WeakSet(); |
@@ -11,3 +11,3 @@ type NotifyCallback = () => void; | ||
*/ | ||
readonly batchCalls: <T_1 extends unknown[]>(callback: BatchCallsCallback<T_1>) => BatchCallsCallback<T_1>; | ||
readonly batchCalls: <T extends Array<unknown>>(callback: BatchCallsCallback<T>) => BatchCallsCallback<T>; | ||
readonly schedule: (callback: NotifyCallback) => void; | ||
@@ -31,3 +31,3 @@ /** | ||
*/ | ||
readonly batchCalls: <T_1 extends unknown[]>(callback: BatchCallsCallback<T_1>) => BatchCallsCallback<T_1>; | ||
readonly batchCalls: <T extends Array<unknown>>(callback: BatchCallsCallback<T>) => BatchCallsCallback<T>; | ||
readonly schedule: (callback: NotifyCallback) => void; | ||
@@ -34,0 +34,0 @@ /** |
@@ -158,18 +158,9 @@ // src/queriesObserver.ts | ||
} else { | ||
const existingObserver = this.#observers.find( | ||
(o) => o.options.queryHash === defaultedOptions.queryHash | ||
); | ||
observers.push({ | ||
defaultedQueryOptions: defaultedOptions, | ||
observer: existingObserver ?? new QueryObserver(this.#client, defaultedOptions) | ||
observer: new QueryObserver(this.#client, defaultedOptions) | ||
}); | ||
} | ||
}); | ||
return observers.sort((a, b) => { | ||
return queries.findIndex( | ||
(q) => q.queryHash === a.defaultedQueryOptions.queryHash | ||
) - queries.findIndex( | ||
(q) => q.queryHash === b.defaultedQueryOptions.queryHash | ||
); | ||
}); | ||
return observers; | ||
} | ||
@@ -176,0 +167,0 @@ #onUpdate(observer, result) { |
{ | ||
"name": "@tanstack/query-core", | ||
"version": "5.60.6", | ||
"version": "5.61.4", | ||
"description": "The framework agnostic core that powers TanStack Query", | ||
@@ -40,3 +40,6 @@ "author": "tannerlinsley", | ||
], | ||
"devDependencies": { | ||
"@testing-library/dom": "^10.4.0" | ||
}, | ||
"scripts": {} | ||
} |
@@ -243,10 +243,5 @@ import { notifyManager } from './notifyManager' | ||
} else { | ||
const existingObserver = this.#observers.find( | ||
(o) => o.options.queryHash === defaultedOptions.queryHash, | ||
) | ||
observers.push({ | ||
defaultedQueryOptions: defaultedOptions, | ||
observer: | ||
existingObserver ?? | ||
new QueryObserver(this.#client, defaultedOptions), | ||
observer: new QueryObserver(this.#client, defaultedOptions), | ||
}) | ||
@@ -256,12 +251,3 @@ } | ||
return observers.sort((a, b) => { | ||
return ( | ||
queries.findIndex( | ||
(q) => q.queryHash === a.defaultedQueryOptions.queryHash, | ||
) - | ||
queries.findIndex( | ||
(q) => q.queryHash === b.defaultedQueryOptions.queryHash, | ||
) | ||
) | ||
}) | ||
return observers | ||
} | ||
@@ -268,0 +254,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1832810
1
22065
14
108