You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
originalArgs?:unknown// Arguments passed to the query
265
-
data?:T// The latest returned result regardless of hook arg, if present
266
-
currentData?:T// The latest returned result for the current hook arg, if present
267
-
error?:unknown// Error result if present
268
-
requestId?:string// A string generated by RTK Query
269
-
endpointName?:string// The name of the given endpoint for the query
270
-
startedTimeStamp?:number// Timestamp for when the query was initiated
271
-
fulfilledTimeStamp?:number// Timestamp for when the query was completed
266
+
267
+
// Arguments passed to the query
268
+
originalArgs?:unknown
269
+
// The latest returned result regardless of hook arg, if present
270
+
data?:T
271
+
// The latest returned result for the current hook arg, if present
272
+
currentData?:T
273
+
// Error result if present
274
+
error?:unknown
275
+
// A string generated by RTK Query
276
+
requestId?:string
277
+
// The name of the given endpoint for the query
278
+
endpointName?:string
279
+
// Timestamp for when the query was initiated
280
+
startedTimeStamp?:number
281
+
// Timestamp for when the query was completed
282
+
fulfilledTimeStamp?:number
272
283
273
284
// Derived request status booleans
274
-
isUninitialized:boolean// Query has not started yet.
275
-
isLoading:boolean// Query is currently loading for the first time. No data yet.
276
-
isFetching:boolean// Query is currently fetching, but might have data from an earlier request.
277
-
isSuccess:boolean// Query has data from a successful load.
278
-
isError:boolean// Query is currently in an "error" state.
279
285
280
-
refetch: () =>QueryActionCreatorResult// A function to force refetch the query - returns a Promise with additional methods
286
+
// Query has not started yet.
287
+
isUninitialized:boolean
288
+
// Query is currently loading for the first time. No data yet.
289
+
isLoading:boolean
290
+
// Query is currently fetching, but might have data from an earlier request.
291
+
isFetching:boolean
292
+
// Query has data from a successful load.
293
+
isSuccess:boolean
294
+
// Query is currently in an "error" state.
295
+
isError:boolean
296
+
297
+
// A function to force refetch the query - returns a Promise with additional methods
298
+
refetch: () =>QueryActionCreatorResult
281
299
}
282
300
```
283
301
@@ -288,11 +306,7 @@ type UseQueryResult<T> = {
288
306
- **Returns**
289
307
- A query result object containing the current loading state, the actual data or error returned from the API call, metadata about the request, and a function to `refetch` the data. Can be customized with `selectFromResult`
@@ -398,20 +425,36 @@ type UseQueryStateOptions = {
398
425
399
426
typeUseQueryStateResult<T> = {
400
427
// Base query state
401
-
originalArgs?:unknown// Arguments passed to the query
402
-
data?:T// The latest returned result regardless of hook arg, if present
403
-
currentData?:T// The latest returned result for the current hook arg, if present
404
-
error?:unknown// Error result if present
405
-
requestId?:string// A string generated by RTK Query
406
-
endpointName?:string// The name of the given endpoint for the query
407
-
startedTimeStamp?:number// Timestamp for when the query was initiated
408
-
fulfilledTimeStamp?:number// Timestamp for when the query was completed
409
-
410
-
isUninitialized:false// Query has not started yet.
411
-
isLoading:false// Query is currently loading for the first time. No data yet.
412
-
isFetching:false// Query is currently fetching, but might have data from an earlier request.
413
-
isSuccess:false// Query has data from a successful load.
414
-
isError:false// Query is currently in an "error" state.
428
+
429
+
// Arguments passed to the query
430
+
originalArgs?:unknown
431
+
// The latest returned result regardless of hook arg, if present
432
+
data?:T
433
+
// The latest returned result for the current hook arg, if present
434
+
currentData?:T
435
+
// Error result if present
436
+
error?:unknown
437
+
// A string generated by RTK Query
438
+
requestId?:string
439
+
// The name of the given endpoint for the query
440
+
endpointName?:string
441
+
// Timestamp for when the query was initiated
442
+
startedTimeStamp?:number
443
+
// Timestamp for when the query was completed
444
+
fulfilledTimeStamp?:number
445
+
446
+
// Derived request status booleans
447
+
448
+
// Query has not started yet.
449
+
isUninitialized:boolean
450
+
// Query is currently loading for the first time. No data yet.
451
+
isLoading:boolean
452
+
// Query is currently fetching, but might have data from an earlier request.
453
+
isFetching:boolean
454
+
// Query has data from a successful load.
455
+
isSuccess:boolean
456
+
// Query is currently in an "error" state.
457
+
isError:boolean
415
458
}
416
459
```
417
460
@@ -424,17 +467,15 @@ type UseQueryStateResult<T> = {
424
467
- **Returns**
425
468
- A query result object containing the current loading state, the actual data or error returned from the API call and metadata about the request. Can be customized with `selectFromResult`
arg:unknown// Whatever argument was provided to the query
500
-
requestId:string// A string generated by RTK Query
501
-
subscriptionOptions:SubscriptionOptions// The values used for the query subscription
502
-
abort: () =>void// A method to cancel the query promise
503
-
unwrap: () =>Promise<T> // A method to unwrap the query call and provide the raw response/error
504
-
unsubscribe: () =>void// A method used to manually unsubscribe from the query results
505
-
refetch: () =>void// A method used to re-run the query. In most cases when using a lazy query, you will never use this and should prefer to call the trigger again.
506
-
updateSubscriptionOptions: (options:SubscriptionOptions) () =>void// A method used to update the subscription options (eg. pollingInterval)
538
+
// Whatever argument was provided to the query
539
+
arg:unknown
540
+
// A string generated by RTK Query
541
+
requestId:string
542
+
// The values used for the query subscription
543
+
subscriptionOptions:SubscriptionOptions
544
+
545
+
// A method to cancel the query promise
546
+
abort: () =>void
547
+
// A method to unwrap the query call and provide the raw response/error
548
+
unwrap: () =>Promise<T>
549
+
// A method used to manually unsubscribe from the query results
550
+
unsubscribe: () =>void
551
+
// A method used to re-run the query. In most cases when using a lazy query, you will never use this and should prefer to call the trigger again.
552
+
refetch: () =>void
553
+
// A method used to update the subscription options (eg. pollingInterval)
originalArgs?:unknown// Arguments passed to the query
512
-
data?:T// The latest returned result regardless of trigger arg, if present
513
-
currentData?:T// The latest returned result for the trigger arg, if present
514
-
error?:unknown// Error result if present
515
-
requestId?:string// A string generated by RTK Query
516
-
endpointName?:string// The name of the given endpoint for the query
517
-
startedTimeStamp?:number// Timestamp for when the query was initiated
518
-
fulfilledTimeStamp?:number// Timestamp for when the query was completed
519
-
520
-
isUninitialized:false// Query has not started yet.
521
-
isLoading:false// Query is currently loading for the first time. No data yet.
522
-
isFetching:false// Query is currently fetching, but might have data from an earlier request.
523
-
isSuccess:false// Query has data from a successful load.
524
-
isError:false// Query is currently in an "error" state.
559
+
560
+
// Arguments passed to the query
561
+
originalArgs?:unknown
562
+
// The latest returned result regardless of hook arg, if present
563
+
data?:T
564
+
// The latest returned result for the current hook arg, if present
565
+
currentData?:T
566
+
// Error result if present
567
+
error?:unknown
568
+
// A string generated by RTK Query
569
+
requestId?:string
570
+
// The name of the given endpoint for the query
571
+
endpointName?:string
572
+
// Timestamp for when the query was initiated
573
+
startedTimeStamp?:number
574
+
// Timestamp for when the query was completed
575
+
fulfilledTimeStamp?:number
576
+
577
+
// Derived request status booleans
578
+
579
+
// Query has not started yet.
580
+
isUninitialized:boolean
581
+
// Query is currently loading for the first time. No data yet.
582
+
isLoading:boolean
583
+
// Query is currently fetching, but might have data from an earlier request.
584
+
isFetching:boolean
585
+
// Query has data from a successful load.
586
+
isSuccess:boolean
587
+
// Query is currently in an "error" state.
588
+
isError:boolean
525
589
}
526
590
527
591
typeUseLazyQueryLastPromiseInfo= {
@@ -538,18 +602,16 @@ type UseLazyQueryLastPromiseInfo = {
538
602
- `result`: A query result object containing the current loading state, the actual data or error returned from the API call and metadata about the request. Can be customized with `selectFromResult`
539
603
- `lastPromiseInfo`: An object containing the last argument used to call the trigger function
0 commit comments