This is the documentation of version 0.62.3. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Type Alias LatestRequest

    One in-flight request slot, where each new request retires the one before it.

    type LatestRequest = {
        cancel: () => void;
        isRunning: () => boolean;
        run: <T>(
            request: (signal: AbortSignal) => Promise<T>,
        ) => Promise<LatestRequestResult<T>>;
    }
    Index
    cancel: () => void

    Aborts the request in flight without starting another, so it resolves { current: false }.

    isRunning: () => boolean

    Whether a request is in flight and not yet retired.

    run: <T>(
        request: (signal: AbortSignal) => Promise<T>,
    ) => Promise<LatestRequestResult<T>>

    Aborts the request in flight, if any, then starts this one.

    Type Declaration

      • <T>(
            request: (signal: AbortSignal) => Promise<T>,
        ): Promise<LatestRequestResult<T>>
      • Type Parameters

        • T

        Parameters

        • request: (signal: AbortSignal) => Promise<T>

          The work to run, typically one or more service calls sharing the signal

        Returns Promise<LatestRequestResult<T>>

    request is called synchronously with a fresh signal, which it passes to every service call it makes. A rejection is rethrown only while the request is still current, so a deadline of your own composed onto the signal still surfaces as an SDKAbortError.