Options
All
  • Public
  • Public/Protected
  • All
Menu

Context of a request

Type parameters

  • D = unknown

    response data

Hierarchy

Index

Constructors

Properties

cache: default<Nullable<D>, string>

Storage to cache the resolved request

cacheTimeoutId?: number

Cache TTL identifier

canCache: boolean

True if the request can be cached

isReady: Promise<void>

Promise that resolves when the instance is already initialized

Request parameters

parent: default<unknown>

Link to a parent operation promise

pendingCache: default<RequestResponse<D> | ControllablePromise<RequestResponse<D>>, string> = ...

Storage to cache the request while it is pending a response

withoutBody: boolean

True if the request can provide parameters only as a query string

Accessors

Methods

  • dropCache(): void
  • getRequestKey(url: string): string
  • resolveAPI(apiURL?: Nullable<string>): string
  • resolveRequest(url?: Nullable<string>): string
  • resolveURL(url?: Nullable<string>): string
  • decorateContext<CTX>(ctx: CTX, path: string, resolver?: RequestResolver<unknown, unknown[]>, ...args: unknown[]): CTX
  • Forks the specified request context and decorates it with additional parameters

    Type parameters

    Parameters

    • ctx: CTX
    • path: string

      request path URL

    • Optional resolver: RequestResolver<unknown, unknown[]>

      function to resolve a request

    • Rest ...args: unknown[]

      additional arguments for the resolver

    Returns CTX