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

    Type Alias SuspenseWatchOptions

    Options that control how SuspenseWatch reports and samples events.

    type SuspenseWatchOptions = {
        timeoutMs?: number;
        sampleRate?: number;
        reportResolveAfterSlow?: boolean;
        actionNames?: { slow?: string; resolved?: string };
        onSlow?: (info: SuspenseSlowInfo) => void;
        onResolvedAfterSlow?: (info: SuspenseResolvedInfo) => void;
        alsoReportError?: boolean;
    }
    Index

    Properties

    timeoutMs?: number

    Milliseconds the fallback may remain visible before it's considered "slow".

    1200
    
    sampleRate?: number

    % sample rate for telemetry (0–100). Set to 0 to disable Datadog reporting.

    20
    
    reportResolveAfterSlow?: boolean

    Emit a second event when content finally resolves after a slow fallback.

    true
    
    actionNames?: { slow?: string; resolved?: string }

    Action names for Datadog. Usually you won't need to change these.

    Type declaration

    • Optionalslow?: string

      Emitted once when the fallback crosses timeoutMs.

    • Optionalresolved?: string

      Emitted when a slow fallback eventually resolves.

    onSlow?: (info: SuspenseSlowInfo) => void

    Optional callback when the fallback crosses timeoutMs. Receives timing info; return value is ignored.

    onResolvedAfterSlow?: (info: SuspenseResolvedInfo) => void

    Optional callback when the slow fallback eventually resolves.

    alsoReportError?: boolean

    If true, also send a Datadog error on slow fallback (grouped as error). Useful when prolonged loading is considered a defect.

    false