A factory which can create Request objects. Useful for adding "default" handlers to requests.

Hierarchy

  • RequestFactory

Constructors

Methods

  • Add a function which will be invoked for every request that is rejected.

    Parameters

    • fn: HandlerFunction

      The function to invoke. The first argument will be the Request object, the second will be the rejection argument.

    Returns void

  • Add a function which will be invoked for every request that is resolved.

    Parameters

    • fn: HandlerFunction

      The function to invoke. The first argument will be the Request object, the second will be the resolve argument.

    Returns void

  • Add a function which will be invoked for every request that has not been resolved or rejected within a certain amount of time.

    Parameters

    • fn: TimeoutFunction

      The function to invoke. The first argument will be the Request object.

    • durationMs: number

      The number of milliseconds to wait for a resolution to the request.

    Returns void

  • Generate a new request.

    Returns

    A new request object

    Type Parameters

    • T

    Parameters

    • Optional opts: RequestOpts<T>

      The options to pass to the Request constructor, if any.

    Returns Request<null | T>

Generated using TypeDoc