@tanstack/query-core 5.51.21 → 5.51.24

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["type Listener = () => void\n\nexport class Subscribable<TListener extends Function = Listener> {\n protected listeners: Set<TListener>\n\n constructor() {\n this.listeners = new Set()\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAM,eAAN,MAA0D;AAAA,EAG/D,cAAc;AACZ,SAAK,YAAY,oBAAI,IAAI;AACzB,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable<TListener extends Function> {\n protected listeners = new Set<TListener>()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]}
@@ -1,5 +1,4 @@
1
- type Listener = () => void;
2
- declare class Subscribable<TListener extends Function = Listener> {
1
+ declare class Subscribable<TListener extends Function> {
3
2
  protected listeners: Set<TListener>;
4
3
  constructor();
5
4
  subscribe(listener: TListener): () => void;
@@ -1,5 +1,4 @@
1
- type Listener = () => void;
2
- declare class Subscribable<TListener extends Function = Listener> {
1
+ declare class Subscribable<TListener extends Function> {
3
2
  protected listeners: Set<TListener>;
4
3
  constructor();
5
4
  subscribe(listener: TListener): () => void;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["type Listener = () => void\n\nexport class Subscribable<TListener extends Function = Listener> {\n protected listeners: Set<TListener>\n\n constructor() {\n this.listeners = new Set()\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;AAEO,IAAM,eAAN,MAA0D;AAAA,EAG/D,cAAc;AACZ,SAAK,YAAY,oBAAI,IAAI;AACzB,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable<TListener extends Function> {\n protected listeners = new Set<TListener>()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["type Listener = () => void\n\nexport class Subscribable<TListener extends Function = Listener> {\n protected listeners: Set<TListener>\n\n constructor() {\n this.listeners = new Set()\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAM,eAAN,MAA0D;AAAA,EAG/D,cAAc;AACZ,SAAK,YAAY,oBAAI,IAAI;AACzB,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable<TListener extends Function> {\n protected listeners = new Set<TListener>()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]}
@@ -1,5 +1,4 @@
1
- type Listener = () => void;
2
- declare class Subscribable<TListener extends Function = Listener> {
1
+ declare class Subscribable<TListener extends Function> {
3
2
  protected listeners: Set<TListener>;
4
3
  constructor();
5
4
  subscribe(listener: TListener): () => void;
@@ -1,5 +1,4 @@
1
- type Listener = () => void;
2
- declare class Subscribable<TListener extends Function = Listener> {
1
+ declare class Subscribable<TListener extends Function> {
3
2
  protected listeners: Set<TListener>;
4
3
  constructor();
5
4
  subscribe(listener: TListener): () => void;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["type Listener = () => void\n\nexport class Subscribable<TListener extends Function = Listener> {\n protected listeners: Set<TListener>\n\n constructor() {\n this.listeners = new Set()\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";AAEO,IAAM,eAAN,MAA0D;AAAA,EAG/D,cAAc;AACZ,SAAK,YAAY,oBAAI,IAAI;AACzB,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/subscribable.ts"],"sourcesContent":["export class Subscribable<TListener extends Function> {\n protected listeners = new Set<TListener>()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n"],"mappings":";AAAO,IAAM,eAAN,MAA+C;AAAA,EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AAAA,EAC3C;AAAA,EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK,UAAU,OAAO;AAAA,EAC/B;AAAA,EAEU,cAAoB;AAAA,EAE9B;AAAA,EAEU,gBAAsB;AAAA,EAEhC;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/query-core",
3
- "version": "5.51.21",
3
+ "version": "5.51.24",
4
4
  "description": "The framework agnostic core that powers TanStack Query",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -27,7 +27,7 @@ describe('OmitKeyof', () => {
27
27
  // @ts-expect-error Type does not satisfy the constraint keyof A
28
28
  'z' | 'y'
29
29
  >
30
- >().toEqualTypeOf<ExpectedType>
30
+ >().toEqualTypeOf<ExpectedType>()
31
31
  expectTypeOf<
32
32
  OmitKeyof<
33
33
  A,
@@ -36,7 +36,7 @@ describe('OmitKeyof', () => {
36
36
  'z' | 'y',
37
37
  'strictly'
38
38
  >
39
- >().toEqualTypeOf<ExpectedType>
39
+ >().toEqualTypeOf<ExpectedType>()
40
40
 
41
41
  // 2. safely
42
42
  expectTypeOf<
@@ -46,7 +46,7 @@ describe('OmitKeyof', () => {
46
46
  // @ts-expect-error Type does not satisfy the constraint keyof A
47
47
  'z' | 'y'
48
48
  >
49
- >().toEqualTypeOf<ExpectedType>
49
+ >().toEqualTypeOf<ExpectedType>()
50
50
  expectTypeOf<
51
51
  OmitKeyof<
52
52
  A,
@@ -54,7 +54,7 @@ describe('OmitKeyof', () => {
54
54
  'z' | 'y',
55
55
  'safely'
56
56
  >
57
- >().toEqualTypeOf<ExpectedType>
57
+ >().toEqualTypeOf<ExpectedType>()
58
58
  })
59
59
 
60
60
  it("'s number key type check", () => {
@@ -82,7 +82,7 @@ describe('OmitKeyof', () => {
82
82
  // @ts-expect-error Type does not satisfy the constraint keyof A
83
83
  3 | 2
84
84
  >
85
- >().toEqualTypeOf<ExpectedType>
85
+ >().toEqualTypeOf<ExpectedType>()
86
86
  expectTypeOf<
87
87
  OmitKeyof<
88
88
  A,
@@ -91,7 +91,7 @@ describe('OmitKeyof', () => {
91
91
  3 | 2,
92
92
  'strictly'
93
93
  >
94
- >().toEqualTypeOf<ExpectedType>
94
+ >().toEqualTypeOf<ExpectedType>()
95
95
 
96
96
  // 2. safely
97
97
  expectTypeOf<
@@ -101,7 +101,7 @@ describe('OmitKeyof', () => {
101
101
  // @ts-expect-error Type does not satisfy the constraint keyof A
102
102
  3 | 2
103
103
  >
104
- >().toEqualTypeOf<ExpectedType>
104
+ >().toEqualTypeOf<ExpectedType>()
105
105
  expectTypeOf<
106
106
  OmitKeyof<
107
107
  A,
@@ -109,7 +109,7 @@ describe('OmitKeyof', () => {
109
109
  3 | 2,
110
110
  'safely'
111
111
  >
112
- >().toEqualTypeOf<ExpectedType>
112
+ >().toEqualTypeOf<ExpectedType>()
113
113
  })
114
114
 
115
115
  it("'s symbol key type check", () => {
@@ -143,7 +143,7 @@ describe('OmitKeyof', () => {
143
143
  // @ts-expect-error Type does not satisfy the constraint keyof A
144
144
  typeof symbol3 | typeof symbol2
145
145
  >
146
- >().toEqualTypeOf<ExpectedType>
146
+ >().toEqualTypeOf<ExpectedType>()
147
147
  expectTypeOf<
148
148
  OmitKeyof<
149
149
  A,
@@ -152,7 +152,7 @@ describe('OmitKeyof', () => {
152
152
  typeof symbol3 | typeof symbol2,
153
153
  'strictly'
154
154
  >
155
- >().toEqualTypeOf<ExpectedType>
155
+ >().toEqualTypeOf<ExpectedType>()
156
156
 
157
157
  // 2. safely
158
158
  expectTypeOf<
@@ -162,7 +162,7 @@ describe('OmitKeyof', () => {
162
162
  // @ts-expect-error Type does not satisfy the constraint keyof A
163
163
  typeof symbol3 | typeof symbol2
164
164
  >
165
- >().toEqualTypeOf<ExpectedType>
165
+ >().toEqualTypeOf<ExpectedType>()
166
166
  expectTypeOf<
167
167
  OmitKeyof<
168
168
  A,
@@ -170,6 +170,6 @@ describe('OmitKeyof', () => {
170
170
  typeof symbol3 | typeof symbol2,
171
171
  'safely'
172
172
  >
173
- >().toEqualTypeOf<ExpectedType>
173
+ >().toEqualTypeOf<ExpectedType>()
174
174
  })
175
175
  })
@@ -348,7 +348,7 @@ describe('mutations', () => {
348
348
  expect(error).toEqual(new Error('No mutationFn found'))
349
349
  })
350
350
 
351
- test('mutate update the mutation state even without an active subscription', async () => {
351
+ test('mutate update the mutation state even without an active subscription 1', async () => {
352
352
  const onSuccess = vi.fn()
353
353
  const onSettled = vi.fn()
354
354
 
@@ -364,7 +364,7 @@ describe('mutations', () => {
364
364
  expect(onSettled).not.toHaveBeenCalled()
365
365
  })
366
366
 
367
- test('mutate update the mutation state even without an active subscription', async () => {
367
+ test('mutate update the mutation state even without an active subscription 2', async () => {
368
368
  const onSuccess = vi.fn()
369
369
  const onSettled = vi.fn()
370
370
 
@@ -218,13 +218,13 @@ describe('queryClient', () => {
218
218
  expect(testCache.find({ queryKey: key })).toBe(testCache.get('someKey'))
219
219
  })
220
220
 
221
- test('should create a new query if query was not found', () => {
221
+ test('should create a new query if query was not found 1', () => {
222
222
  const key = queryKey()
223
223
  queryClient.setQueryData(key, 'bar')
224
224
  expect(queryClient.getQueryData(key)).toBe('bar')
225
225
  })
226
226
 
227
- test('should create a new query if query was not found', () => {
227
+ test('should create a new query if query was not found 2', () => {
228
228
  const key = queryKey()
229
229
  queryClient.setQueryData(key, 'qux')
230
230
  expect(queryClient.getQueryData(key)).toBe('qux')
@@ -1074,7 +1074,7 @@ describe('queryClient', () => {
1074
1074
  expect(queryFn2).toHaveBeenCalledTimes(1)
1075
1075
  })
1076
1076
 
1077
- test('should be able to refetch all active and inactive queries', async () => {
1077
+ test('should be able to refetch all active and inactive queries (queryClient.refetchQueries()', async () => {
1078
1078
  const key1 = queryKey()
1079
1079
  const key2 = queryKey()
1080
1080
  const queryFn1 = vi
@@ -1097,7 +1097,7 @@ describe('queryClient', () => {
1097
1097
  expect(queryFn2).toHaveBeenCalledTimes(2)
1098
1098
  })
1099
1099
 
1100
- test('should be able to refetch all active and inactive queries', async () => {
1100
+ test('should be able to refetch all active and inactive queries (queryClient.refetchQueries({ type: "all" }))', async () => {
1101
1101
  const key1 = queryKey()
1102
1102
  const key2 = queryKey()
1103
1103
  const queryFn1 = vi
@@ -157,7 +157,7 @@ describe('queryObserver', () => {
157
157
  unsubscribe()
158
158
  })
159
159
 
160
- test('should not be re-fetched if not subscribed to after enabled was toggled to true', async () => {
160
+ test('should not be re-fetched if not subscribed to after enabled was toggled to true (fetchStatus: "idle")', async () => {
161
161
  const unsubscribe = observer.subscribe(vi.fn())
162
162
 
163
163
  // Toggle enabled
@@ -175,7 +175,7 @@ describe('queryObserver', () => {
175
175
  expect(count).toBe(0)
176
176
  })
177
177
 
178
- test('should not be re-fetched if not subscribed to after enabled was toggled to true', async () => {
178
+ test('should not be re-fetched if not subscribed to after enabled was toggled to true (fetchStatus: "fetching")', async () => {
179
179
  const unsubscribe = observer.subscribe(vi.fn())
180
180
 
181
181
  // Toggle enabled
@@ -1,10 +1,7 @@
1
- type Listener = () => void
2
-
3
- export class Subscribable<TListener extends Function = Listener> {
4
- protected listeners: Set<TListener>
1
+ export class Subscribable<TListener extends Function> {
2
+ protected listeners = new Set<TListener>()
5
3
 
6
4
  constructor() {
7
- this.listeners = new Set()
8
5
  this.subscribe = this.subscribe.bind(this)
9
6
  }
10
7