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
Copy file name to clipboardExpand all lines: packages/toolkit/src/query/core/buildMiddleware/queryLifecycle.ts
+60Lines changed: 60 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,66 @@ export type QueryLifecycleQueryExtraOptions<
116
116
): Promise<void>|void
117
117
}
118
118
119
+
exporttypeQueryLifecycleMutationExtraOptions<
120
+
ResultType,
121
+
QueryArg,
122
+
BaseQueryextendsBaseQueryFn,
123
+
ReducerPathextendsstring=string,
124
+
>={
125
+
/**
126
+
* A function that is called when the individual mutation is started. The function is called with a lifecycle api object containing properties such as `queryFulfilled`, allowing code to be run when a query is started, when it succeeds, and when it fails (i.e. throughout the lifecycle of an individual query/mutation call).
127
+
*
128
+
* Can be used for `optimistic updates`.
129
+
*
130
+
* @example
131
+
*
132
+
* ```ts
133
+
* import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'
0 commit comments