MutationResult
Defined in: react/src/types.ts:471
Result from createMutation.
Type Parameters
Section titled “Type Parameters”Service
Section titled “Service”Service = BaseActor
Method
Section titled “Method”Method extends FunctionName<Service> = FunctionName<Service>
Transform
Section titled “Transform”Transform extends TransformKey = "candid"
Properties
Section titled “Properties”useMutation
Section titled “useMutation”useMutation: <
TOnMutateResult>(options?) =>UseMutationResult<ReactorReturnOk<Service,Method,Transform>,ReactorReturnErr<Service,Method,Transform>,ReactorArgs<Service,Method,Transform>,TOnMutateResult>
Defined in: react/src/types.ts:486
React hook for the mutation. Accepts options to override/extend the factory config.
Type Parameters
Section titled “Type Parameters”TOnMutateResult
Section titled “TOnMutateResult”TOnMutateResult = unknown
Parameters
Section titled “Parameters”options?
Section titled “options?”MutationHookOptions<Service, Method, Transform, TOnMutateResult>
Returns
Section titled “Returns”UseMutationResult<ReactorReturnOk<Service, Method, Transform>, ReactorReturnErr<Service, Method, Transform>, ReactorArgs<Service, Method, Transform>, TOnMutateResult>
Example
Section titled “Example”// With invalidateQueries to auto-update balance after transferconst { mutate } = icpTransferMutation.useMutation({ invalidateQueries: [userBalanceQuery], // Auto-invalidate after success!})execute
Section titled “execute”execute: (
args) =>Promise<ReactorReturnOk<Service,Method,Transform>>
Defined in: react/src/types.ts:496
Execute the update call directly (outside of React)
Parameters
Section titled “Parameters”ReactorArgs<Service, Method, Transform>
Returns
Section titled “Returns”Promise<ReactorReturnOk<Service, Method, Transform>>