TanStack
API Reference

MutationObserverIdleResult

Defined in: packages/query-core/src/types.ts:2147

A mutation result in the idle state: the mutation hasn't run yet, or was reset.

Extends

Type Parameters

TData

TData = unknown

TError

TError = DefaultError

TVariables

TVariables = void

TOnMutateResult

TOnMutateResult = unknown

Properties

PropertyTypeDescriptionOverrides
contextTOnMutateResult | undefinedThe value returned by onMutate, if defined. Passed to onSuccess, onError and onSettled as the mutation's context.-
dataundefinedundefined, since the mutation hasn't run.MutationObserverBaseResult.data
errornullnull, since the mutation hasn't failed.MutationObserverBaseResult.error
failureCountnumberThe number of times the mutation function has failed for the current attempt.-
failureReasonTError | nullThe reason the current attempt failed, as reported by the retryer.-
isErrorfalsefalse, since the mutation hasn't failed.MutationObserverBaseResult.isError
isIdletruetrue, since the mutation hasn't run yet or was reset.MutationObserverBaseResult.isIdle
isPausedbooleanWhether the mutation is currently paused (see network mode), or is waiting for another mutation with the same scope to finish.-
isPendingfalsefalse, since the mutation isn't running.MutationObserverBaseResult.isPending
isSuccessfalsefalse, since the mutation hasn't succeeded.MutationObserverBaseResult.isSuccess
mutateMutateFunction<TData, TError, TVariables, TOnMutateResult>The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. Param The variables object to pass to the mutationFn. Param This function will fire when the mutation is successful and will be passed the mutation's result. Param This function will fire if the mutation encounters an error and will be passed the error. Param 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() => voidA function to clean the mutation internal state (i.e., it resets the mutation to its initial state).-
status"idle"'idle', since the mutation hasn't run yet or was reset.MutationObserverBaseResult.status
submittedAtnumberThe timestamp for when the mutation was submitted.-
variablesundefinedundefined, since the mutation hasn't run.MutationObserverBaseResult.variables