@@ -500,30 +500,20 @@ In the case of an unhandled error, no tags will be "provided" or "invalidated".`
500
500
}
501
501
}
502
502
503
- type CalculatableAction = UnwrapPromise <
504
- ReturnType < ReturnType < QueryThunk > > | ReturnType < ReturnType < MutationThunk > >
505
- >
506
503
export function calculateProvidedByThunk (
507
- action : CalculatableAction ,
504
+ action : UnwrapPromise <
505
+ ReturnType < ReturnType < QueryThunk > > | ReturnType < ReturnType < MutationThunk > >
506
+ > ,
508
507
type : 'providesTags' | 'invalidatesTags' ,
509
508
endpointDefinitions : EndpointDefinitions ,
510
509
assertTagType : AssertTagTypes
511
510
) {
512
- const isQuery = ( action : CalculatableAction ) =>
513
- action . meta . arg . type === 'query'
514
- const isFulfilledQuery = ( action : any ) : action is QueryThunk =>
515
- isQuery ( action )
516
- const isFulfilledMutation = ( action : any ) : action is MutationThunk =>
517
- ! isQuery ( action )
518
-
519
511
return calculateProvidedBy (
520
512
endpointDefinitions [ action . meta . arg . endpointName ] [ type ] ,
521
513
isFulfilled ( action ) ? action . payload : undefined ,
522
514
isRejectedWithValue ( action ) ? action . payload : undefined ,
523
515
action . meta . arg . originalArgs ,
524
- isAnyOf ( isRejected , isFulfilledQuery , isFulfilledMutation ) ( action )
525
- ? action . meta . baseQueryMeta
526
- : undefined ,
516
+ 'baseQueryMeta' in action . meta ? action . meta . baseQueryMeta : undefined ,
527
517
assertTagType
528
518
)
529
519
}
0 commit comments