Skip to content

Documentation / @ember-data/request / index / CacheHandler

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:219

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/declarations/request/-private/types.d.ts:229

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.