Skip to content

Documentation / @warp-drive/utilities / handlers / Gate

Class: Gate

Defined in: -private/handlers/gated.ts:15

Implements

Constructors

Constructor

ts
new Gate(handler, checkFn): Gate;

Defined in: -private/handlers/gated.ts:19

Parameters

handler

Handler

checkFn

CheckFn

Returns

Gate

Methods

request()

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

Defined in: -private/handlers/gated.ts:24

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

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

Implementation of

Handler.request

Properties

checkFn

ts
checkFn: CheckFn;

Defined in: -private/handlers/gated.ts:17


handler

ts
handler: Handler;

Defined in: -private/handlers/gated.ts:16

Released under the MIT License.