Skip to content

Commit

Permalink
Add undefined error and data properties to the descriminated union to…
Browse files Browse the repository at this point in the history
… improve usability
  • Loading branch information
jared-ca committed Apr 11, 2024
1 parent c189792 commit 6aea6c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/toolkit/src/query/core/buildInitiate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ type StartMutationActionCreator<
export type MutationActionCreatorResult<
D extends MutationDefinition<any, any, any, any>,
> = SafePromise<
| { data: ResultTypeFrom<D> }
| {
data: ResultTypeFrom<D>
error?: undefined
}
| {
data?: undefined
error:
| Exclude<
BaseQueryError<
Expand Down

0 comments on commit 6aea6c8

Please sign in to comment.