本页还没有译文
本页 6 段还没译成Tiếng Việt,下面显示的是英文原文。MutationCacheConfig
还没翻译译自英文(tanstack.com)本页 6 段都还没译
Defined in: packages/query-core/src/mutationCache.ts:26
Global callbacks that fire for every mutation handled by a MutationCache, regardless of which
component or observer triggered it. They differ from the defaultOptions provided to a
QueryClient in two ways: defaultOptions can be overridden by each mutation, while these
callbacks are always called, and onMutate here does not allow returning a result.
If a callback returns a promise, it will be awaited before the mutation continues.
Properties
| Property | Type | Description |
|---|---|---|
onError? | (error: Error, variables: unknown, onMutateResult: unknown, mutation: Mutation<unknown, unknown, unknown>, context: MutationFunctionContext) => unknown | Called when any mutation in the cache encounters an error. |
onMutate? | (variables: unknown, mutation: Mutation<unknown, unknown, unknown>, context: MutationFunctionContext) => unknown | Called before any mutation in the cache executes. |
onSettled? | (data: unknown, error: Error | null, variables: unknown, onMutateResult: unknown, mutation: Mutation<unknown, unknown, unknown>, context: MutationFunctionContext) => unknown | Called when any mutation in the cache is settled, either successfully or with an error. |
onSuccess? | (data: unknown, variables: unknown, onMutateResult: unknown, mutation: Mutation<unknown, unknown, unknown>, context: MutationFunctionContext) => unknown | Called when any mutation in the cache is successful. |
AI 翻译查看英文原文