@dypai-ai/client-sdk - v1.12.0
    Preparing search index...

    Interface UseMutationReturn<TBody, TResponse>

    Return type of the useAction hook.

    interface UseMutationReturn<TBody = any, TResponse = any> {
        data: TResponse | null;
        error: DypaiError | null;
        isLoading: boolean;
        mutate: (
            body?: TBody,
        ) => Promise<{ data: TResponse | null; error: DypaiError | null }>;
        reset: () => void;
    }

    Type Parameters

    • TBody = any
    • TResponse = any
    Index

    Properties

    data: TResponse | null

    The response data from the last successful mutation

    error: DypaiError | null

    Error from the last mutation

    isLoading: boolean

    Whether the mutation is in progress

    mutate: (
        body?: TBody,
    ) => Promise<{ data: TResponse | null; error: DypaiError | null }>

    Execute the mutation

    reset: () => void

    Reset state (clear data and error)