datadog-ux-utils Documentation - v1.0.0
    Preparing search index...

    Function useGuardedCall

    • Guard any async call (Axios, graphql, SDK).

      Usage: const guardedCall = useGuardedCall(apiGuard, { onBlocked: toast }); const data = await guardedCall('POST /api/orders', () => axios.post(...));

      Parameters

      Returns <T>(key: string, call: () => Promise<T>) => Promise<undefined | T>