@tanstack/query-core
Advanced tools
Comparing version 5.59.10 to 5.59.12
@@ -305,15 +305,3 @@ import { | ||
}; | ||
return result; | ||
} | ||
updateResult(notifyOptions) { | ||
const prevResult = __privateGet(this, _currentResult); | ||
const nextResult = this.createResult(__privateGet(this, _currentQuery), this.options); | ||
__privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); | ||
__privateSet(this, _currentResultOptions, this.options); | ||
if (__privateGet(this, _currentResultState).data !== void 0) { | ||
__privateSet(this, _lastQueryWithDefinedData, __privateGet(this, _currentQuery)); | ||
} | ||
if (shallowEqualObjects(nextResult, prevResult)) { | ||
return; | ||
} | ||
const nextResult = result; | ||
if (this.options.experimental_prefetchInRender) { | ||
@@ -348,2 +336,15 @@ const finalizeThenableIfPossible = (thenable) => { | ||
} | ||
return nextResult; | ||
} | ||
updateResult(notifyOptions) { | ||
const prevResult = __privateGet(this, _currentResult); | ||
const nextResult = this.createResult(__privateGet(this, _currentQuery), this.options); | ||
__privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); | ||
__privateSet(this, _currentResultOptions, this.options); | ||
if (__privateGet(this, _currentResultState).data !== void 0) { | ||
__privateSet(this, _lastQueryWithDefinedData, __privateGet(this, _currentQuery)); | ||
} | ||
if (shallowEqualObjects(nextResult, prevResult)) { | ||
return; | ||
} | ||
__privateSet(this, _currentResult, nextResult); | ||
@@ -350,0 +351,0 @@ const defaultNotifyOptions = {}; |
@@ -346,15 +346,3 @@ // src/queryObserver.ts | ||
}; | ||
return result; | ||
} | ||
updateResult(notifyOptions) { | ||
const prevResult = this.#currentResult; | ||
const nextResult = this.createResult(this.#currentQuery, this.options); | ||
this.#currentResultState = this.#currentQuery.state; | ||
this.#currentResultOptions = this.options; | ||
if (this.#currentResultState.data !== void 0) { | ||
this.#lastQueryWithDefinedData = this.#currentQuery; | ||
} | ||
if (shallowEqualObjects(nextResult, prevResult)) { | ||
return; | ||
} | ||
const nextResult = result; | ||
if (this.options.experimental_prefetchInRender) { | ||
@@ -389,2 +377,15 @@ const finalizeThenableIfPossible = (thenable) => { | ||
} | ||
return nextResult; | ||
} | ||
updateResult(notifyOptions) { | ||
const prevResult = this.#currentResult; | ||
const nextResult = this.createResult(this.#currentQuery, this.options); | ||
this.#currentResultState = this.#currentQuery.state; | ||
this.#currentResultOptions = this.options; | ||
if (this.#currentResultState.data !== void 0) { | ||
this.#lastQueryWithDefinedData = this.#currentQuery; | ||
} | ||
if (shallowEqualObjects(nextResult, prevResult)) { | ||
return; | ||
} | ||
this.#currentResult = nextResult; | ||
@@ -391,0 +392,0 @@ const defaultNotifyOptions = {}; |
{ | ||
"name": "@tanstack/query-core", | ||
"version": "5.59.10", | ||
"version": "5.59.12", | ||
"description": "The framework agnostic core that powers TanStack Query", | ||
@@ -5,0 +5,0 @@ "author": "tannerlinsley", |
@@ -597,24 +597,4 @@ import { focusManager } from './focusManager' | ||
return result as QueryObserverResult<TData, TError> | ||
} | ||
const nextResult = result as QueryObserverResult<TData, TError> | ||
updateResult(notifyOptions?: NotifyOptions): void { | ||
const prevResult = this.#currentResult as | ||
| QueryObserverResult<TData, TError> | ||
| undefined | ||
const nextResult = this.createResult(this.#currentQuery, this.options) | ||
this.#currentResultState = this.#currentQuery.state | ||
this.#currentResultOptions = this.options | ||
if (this.#currentResultState.data !== undefined) { | ||
this.#lastQueryWithDefinedData = this.#currentQuery | ||
} | ||
// Only notify and update result if something has changed | ||
if (shallowEqualObjects(nextResult, prevResult)) { | ||
return | ||
} | ||
if (this.options.experimental_prefetchInRender) { | ||
@@ -666,2 +646,24 @@ const finalizeThenableIfPossible = (thenable: PendingThenable<TData>) => { | ||
return nextResult | ||
} | ||
updateResult(notifyOptions?: NotifyOptions): void { | ||
const prevResult = this.#currentResult as | ||
| QueryObserverResult<TData, TError> | ||
| undefined | ||
const nextResult = this.createResult(this.#currentQuery, this.options) | ||
this.#currentResultState = this.#currentQuery.state | ||
this.#currentResultOptions = this.options | ||
if (this.#currentResultState.data !== undefined) { | ||
this.#lastQueryWithDefinedData = this.#currentQuery | ||
} | ||
// Only notify and update result if something has changed | ||
if (shallowEqualObjects(nextResult, prevResult)) { | ||
return | ||
} | ||
this.#currentResult = nextResult | ||
@@ -668,0 +670,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
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
2103412
29978