soundcloud-api-ts-next
    Preparing search index...

    Interface MutationResult<TArgs>

    Return shape for mutation/action hooks (follow, like, repost).

    const { execute, loading, error }: MutationResult<[number]> = useSomeMutation();
    await execute(12345);
    interface MutationResult<TArgs extends any[] = []> {
        error: Error | null;
        execute: (...args: TArgs) => Promise<void>;
        loading: boolean;
    }

    Type Parameters

    • TArgs extends any[] = []

      Tuple type of arguments passed to execute.

    Index

    Properties

    Properties

    error: Error | null

    The error from the last mutation attempt, or null.

    execute: (...args: TArgs) => Promise<void>

    Call this to perform the mutation.

    loading: boolean

    true while the mutation is in flight.