@tanstack/query-core 4.29.10 → 4.29.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/query-core",
3
- "version": "4.29.10",
3
+ "version": "4.29.11",
4
4
  "description": "The framework agnostic core that powers TanStack Query",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
package/src/mutation.ts CHANGED
@@ -129,7 +129,7 @@ export class Mutation<
129
129
  }
130
130
 
131
131
  addObserver(observer: MutationObserver<any, any, any, any>): void {
132
- if (this.observers.indexOf(observer) === -1) {
132
+ if (!this.observers.includes(observer)) {
133
133
  this.observers.push(observer)
134
134
 
135
135
  // Stop the mutation from being garbage collected
package/src/query.ts CHANGED
@@ -282,7 +282,7 @@ export class Query<
282
282
  }
283
283
 
284
284
  addObserver(observer: QueryObserver<any, any, any, any, any>): void {
285
- if (this.observers.indexOf(observer) === -1) {
285
+ if (!this.observers.includes(observer)) {
286
286
  this.observers.push(observer)
287
287
 
288
288
  // Stop the query from being garbage collected
@@ -293,7 +293,7 @@ export class Query<
293
293
  }
294
294
 
295
295
  removeObserver(observer: QueryObserver<any, any, any, any, any>): void {
296
- if (this.observers.indexOf(observer) !== -1) {
296
+ if (this.observers.includes(observer)) {
297
297
  this.observers = this.observers.filter((x) => x !== observer)
298
298
 
299
299
  if (!this.observers.length) {
package/src/utils.ts CHANGED
@@ -88,7 +88,7 @@ export function isValidTimeout(value: unknown): value is number {
88
88
  }
89
89
 
90
90
  export function difference<T>(array1: T[], array2: T[]): T[] {
91
- return array1.filter((x) => array2.indexOf(x) === -1)
91
+ return array1.filter((x) => !array2.includes(x))
92
92
  }
93
93
 
94
94
  export function replaceAt<T>(array: T[], index: number, value: T): T[] {