Skip to content

Commit 5b5a914

Browse files
committed
Add CacheLifecycleMutationExtraOptions
1 parent f8c342f commit 5b5a914

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/toolkit/src/query/core/buildMiddleware/cacheLifecycle.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,23 @@ export type CacheLifecycleQueryExtraOptions<
142142
): Promise<void> | void
143143
}
144144

145+
export type CacheLifecycleMutationExtraOptions<
146+
ResultType,
147+
QueryArg,
148+
BaseQuery extends BaseQueryFn,
149+
ReducerPath extends string = string,
150+
> = {
151+
onCacheEntryAdded?(
152+
arg: QueryArg,
153+
api: MutationCacheLifecycleApi<
154+
QueryArg,
155+
BaseQuery,
156+
ResultType,
157+
ReducerPath
158+
>,
159+
): Promise<void> | void
160+
}
161+
145162
const neverResolvedError = new Error(
146163
'Promise never resolved before cacheEntryRemoved.',
147164
) as Error & {

0 commit comments

Comments
 (0)