Interface Requestable<TRequest, TResponse>

interface Requestable<TRequest, TResponse> {
    request(req): void;
    send(arg, matcher?): Promise<TResponse>;
    (req): void;
}

Type Parameters

  • TRequest
  • TResponse

Hierarchy (view full)

Methods

Methods

  • Get a promise for the next response or error. Note: works best for a queueing service, otherwise may not be the response/error that was triggered by the request.

    Parameters

    • arg: TRequest
    • Optional matcher: ((req, res) => boolean)

    Returns Promise<TResponse>

    Argument

    matcher If an immediate mode (mergeMap) service, and you need a promise for a specific result, not just the first one, provide a function that takes a request and a response and returns true if the response belongs to that request.