Socket
Socket
Sign inDemoInstall

@tanstack/query-core

Package Overview
Dependencies
Maintainers
2
Versions
266
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/query-core - npm Package Compare versions

Comparing version 5.21.4 to 5.21.7

12

build/legacy/queryClient.js

@@ -75,3 +75,4 @@ import {

var _a;
return (_a = __privateGet(this, _queryCache).find({ queryKey })) == null ? void 0 : _a.state.data;
const options = this.defaultQueryOptions({ queryKey });
return (_a = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a.state.data;
}

@@ -89,3 +90,6 @@ ensureQueryData(options) {

setQueryData(queryKey, updater, options) {
const query = __privateGet(this, _queryCache).find({ queryKey });
const defaultedOptions = this.defaultQueryOptions({ queryKey });
const query = __privateGet(this, _queryCache).get(
defaultedOptions.queryHash
);
const prevData = query == null ? void 0 : query.state.data;

@@ -96,3 +100,2 @@ const data = functionalUpdate(updater, prevData);

}
const defaultedOptions = this.defaultQueryOptions({ queryKey });
return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true });

@@ -110,3 +113,4 @@ }

var _a;
return (_a = __privateGet(this, _queryCache).find({ queryKey })) == null ? void 0 : _a.state;
const options = this.defaultQueryOptions({ queryKey });
return (_a = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a.state;
}

@@ -113,0 +117,0 @@ removeQueries(filters) {

@@ -65,3 +65,4 @@ // src/queryClient.ts

getQueryData(queryKey) {
return this.#queryCache.find({ queryKey })?.state.data;
const options = this.defaultQueryOptions({ queryKey });
return this.#queryCache.get(options.queryHash)?.state.data;
}

@@ -79,3 +80,6 @@ ensureQueryData(options) {

setQueryData(queryKey, updater, options) {
const query = this.#queryCache.find({ queryKey });
const defaultedOptions = this.defaultQueryOptions({ queryKey });
const query = this.#queryCache.get(
defaultedOptions.queryHash
);
const prevData = query?.state.data;

@@ -86,3 +90,2 @@ const data = functionalUpdate(updater, prevData);

}
const defaultedOptions = this.defaultQueryOptions({ queryKey });
return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });

@@ -99,3 +102,4 @@ }

getQueryState(queryKey) {
return this.#queryCache.find({ queryKey })?.state;
const options = this.defaultQueryOptions({ queryKey });
return this.#queryCache.get(options.queryHash)?.state;
}

@@ -102,0 +106,0 @@ removeQueries(filters) {

{
"name": "@tanstack/query-core",
"version": "5.21.4",
"version": "5.21.7",
"description": "The framework agnostic core that powers TanStack Query",

@@ -5,0 +5,0 @@ "author": "tannerlinsley",

@@ -122,3 +122,4 @@ import {

getQueryData(queryKey: QueryKey) {
return this.#queryCache.find({ queryKey })?.state.data
const options = this.defaultQueryOptions({ queryKey })
return this.#queryCache.get(options.queryHash)?.state.data
}

@@ -169,10 +170,2 @@

): TInferredQueryFnData | undefined {
const query = this.#queryCache.find<TInferredQueryFnData>({ queryKey })
const prevData = query?.state.data
const data = functionalUpdate(updater, prevData)
if (typeof data === 'undefined') {
return undefined
}
const defaultedOptions = this.defaultQueryOptions<

@@ -186,2 +179,12 @@ any,

const query = this.#queryCache.get<TInferredQueryFnData>(
defaultedOptions.queryHash,
)
const prevData = query?.state.data
const data = functionalUpdate(updater, prevData)
if (typeof data === 'undefined') {
return undefined
}
return this.#queryCache

@@ -210,3 +213,4 @@ .build(this, defaultedOptions)

): QueryState<TQueryFnData, TError> | undefined {
return this.#queryCache.find<TQueryFnData, TError>({ queryKey })?.state
const options = this.defaultQueryOptions({ queryKey })
return this.#queryCache.get<TQueryFnData, TError>(options.queryHash)?.state
}

@@ -213,0 +217,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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc