Skip to content

Commit 14703aa

Browse files
committed
remove options.placeHolderData from deciding whether to assign observer current properties, use equalitycheck on v5
1 parent a017016 commit 14703aa

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

packages/query-core/src/queryObserver.ts

+1-17
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export class QueryObserver<
229229

230230
const result = this.createResult(query, options)
231231

232-
if (shouldAssignObserverCurrentProperties(this, result, options)) {
232+
if (shouldAssignObserverCurrentProperties(this, result)) {
233233
// this assigns the optimistic result to the current Observer
234234
// because if the query function changes, useQuery will be performing
235235
// an effect where it would fetch again.
@@ -754,23 +754,7 @@ function shouldAssignObserverCurrentProperties<
754754
>(
755755
observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,
756756
optimisticResult: QueryObserverResult<TData, TError>,
757-
options: DefaultedQueryObserverOptions<
758-
TQueryFnData,
759-
TError,
760-
TData,
761-
TQueryData,
762-
TQueryKey
763-
>,
764757
) {
765-
// this means we want to put some placeholder data when pending and queryKey
766-
// changed.
767-
if (options.placeholderData !== undefined) {
768-
// re-assign properties only if current data is placeholder data
769-
// which means that data did not arrive yet, so, if there is some cached data
770-
// we need to "prepare" to receive it
771-
return optimisticResult.isPlaceholderData
772-
}
773-
774758
// if the newly created result isn't what the observer is holding as current,
775759
// then we'll need to update the properties as well
776760
if (observer.getCurrentResult() !== optimisticResult) {

0 commit comments

Comments
 (0)