本页还没有译文
本页 16 段还没译成Español,下面显示的是英文原文。MutationObserverSuccessResult
还没翻译译自英文(tanstack.com)本页 16 段都还没译
Defined in: packages/query-core/src/types.ts:2297
A mutation result in the success state after the mutation succeeded.
Extends
MutationObserverBaseResult<TData,TError,TVariables,TOnMutateResult>
Type Parameters
TData
TData = unknown
TError
TError = DefaultError
TVariables
TVariables = void
TOnMutateResult
TOnMutateResult = unknown
Properties
| Property | Type | Description | Overrides |
|---|---|---|---|
context | TOnMutateResult | undefined | The value returned by onMutate, if defined. Passed to onSuccess, onError and onSettled as the mutation's context. | - |
data | TData | The data the mutation resolved with. | MutationObserverBaseResult.data |
error | null | null, since the mutation hasn't failed. | MutationObserverBaseResult.error |
failureCount | number | The number of times the mutation function has failed for the current attempt. | - |
failureReason | TError | null | The reason the current attempt failed, as reported by the retryer. | - |
isError | false | false, since the mutation hasn't failed. | MutationObserverBaseResult.isError |
isIdle | false | false, since the mutation has run. | MutationObserverBaseResult.isIdle |
isPaused | boolean | Whether the mutation is currently paused (see network mode), or is waiting for another mutation with the same scope to finish. | - |
isPending | false | false, since the mutation isn't running. | MutationObserverBaseResult.isPending |
isSuccess | true | true, since the mutation succeeded. | MutationObserverBaseResult.isSuccess |
mutate | MutateFunction<TData, TError, TVariables, TOnMutateResult> | The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. Param variables The variables object to pass to the mutationFn. Param options.onSuccess This function will fire when the mutation is successful and will be passed the mutation's result. Param options.onError This function will fire if the mutation encounters an error and will be passed the error. Param options.onSettled This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. Remarks - If you make multiple requests, onSuccess will fire only after the latest call you've made. - All the callback functions (onSuccess, onError, onSettled) are void functions, and the returned value will be ignored. | - |
reset | () => void | A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). | - |
status | "success" | 'success', since the mutation succeeded. | MutationObserverBaseResult.status |
submittedAt | number | The timestamp for when the mutation was submitted. | - |
variables | TVariables | The variables passed to mutate for this mutation. | MutationObserverBaseResult.variables |
AI 翻译查看英文原文