useRemoteDataMutate overview

Added in v1.0.0


Table of contents


utils

useRemoteDataMutate

Wrapper hook for useMutation.

Forces the mutationFn to return a TaskEither<E, Option<A>> and returns RemoteData<E, A>.

Signature

export default function useRemoteDataMutate<A, E, TError = unknown, TVariables = unknown, TContext = unknown>(
  mutationFn: (variables: TVariables) => Promise<E.Either<E, O.Option<A>>>,
  options: UseMutationOptions<E.Either<E, O.Option<A>>, TError, TVariables, TContext> = {}
): [RD.RemoteData<E, A>, UseMutationResult<E.Either<E, O.Option<A>>, TError, TVariables, TContext>]

Added in v1.0.0