Fetcher implementation which uses fetch-h2 to perform HTTP/1.1 or HTTP/2 calls. Generally more performant than the native fetch API, but less portable.

Implements

Constructors

Properties

_http1: {
    disconnect: ((url) => Promise<void>);
    disconnectAll: (() => Promise<void>);
    fetch: ((input, init?) => Promise<Response>);
    onPush: ((handler?) => void);
    setup: ((opts) => void);
}

Type declaration

  • disconnect: ((url) => Promise<void>)
      • (url): Promise<void>
      • Parameters

        • url: string

        Returns Promise<void>

  • disconnectAll: (() => Promise<void>)
      • (): Promise<void>
      • Returns Promise<void>

  • fetch: ((input, init?) => Promise<Response>)
      • (input, init?): Promise<Response>
      • Parameters

        • input: string | Request
        • Optional init: Partial<FetchInit>

        Returns Promise<Response>

  • onPush: ((handler?) => void)
      • (handler?): void
      • Parameters

        • Optional handler: PushHandler

        Returns void

  • setup: ((opts) => void)
      • (opts): void
      • Parameters

        • opts: Partial<ContextOptions>

        Returns void

_preferred: {
    disconnect: ((url) => Promise<void>);
    disconnectAll: (() => Promise<void>);
    fetch: ((input, init?) => Promise<Response>);
    onPush: ((handler?) => void);
    setup: ((opts) => void);
}

Type declaration

  • disconnect: ((url) => Promise<void>)
      • (url): Promise<void>
      • Parameters

        • url: string

        Returns Promise<void>

  • disconnectAll: (() => Promise<void>)
      • (): Promise<void>
      • Returns Promise<void>

  • fetch: ((input, init?) => Promise<Response>)
      • (input, init?): Promise<Response>
      • Parameters

        • input: string | Request
        • Optional init: Partial<FetchInit>

        Returns Promise<Response>

  • onPush: ((handler?) => void)
      • (handler?): void
      • Parameters

        • Optional handler: PushHandler

        Returns void

  • setup: ((opts) => void)
      • (opts): void
      • Parameters

        • opts: Partial<ContextOptions>

        Returns void

_timeoutErrorCls: typeof TimeoutError

Methods