Skip to content

Documentation / @warp-drive/core / request / CacheHandler

Defined in: warp-drive-packages/core/src/request/-private/types.ts:229

The CacheHandler is identical to other handlers ecxept that it is allowed to return a value synchronously. This is useful for features like reducing microtask queueing when de-duping.

A RequestManager may only have one CacheHandler, registered via manager.useCache(CacheHandler).

(Interface) CacheHandler

Methods

request()

ts
request<T>(context, next): 
  | T
  | Promise<
  | T
  | StructuredDataDocument<T>>
| Future<T>;

Defined in: warp-drive-packages/core/src/request/-private/types.ts:239

Method to implement to handle requests. Receives the request context and a nextFn to call to pass-along the request to other handlers.

Type Parameters

T

T = unknown

Parameters

context

RequestContext

next

NextFn<T>

Returns

| T | Promise< | T | StructuredDataDocument<T>> | Future<T>

Released under the MIT License.