Skip to main content Link Search Menu Expand Document (external link)

Interceptor overview

Added in v0.0.1


Table of contents


combinator

add

Signature

export declare const add: {
  <T extends Interceptor<any, any>>(
    interceptor: T
  ): <E, R>(
    interceptors: Interceptors<E, R>
  ) => T extends Interceptor<infer R2, infer E2> ? Interceptors<E | R2, R | E2> : never
  <T extends Interceptor<any, any>, E, R>(
    interceptors: Interceptors<E, R>,
    interceptor: T
  ): T extends Interceptor<infer R2, infer E2> ? Interceptors<E | R2, R | E2> : never
}

Added in v0.0.1

constructor

copy

Signature

export declare const copy: <E, R>(interceptors: Interceptors<E, R>) => Interceptors<E, R>

Added in v0.0.1

empty

Signature

export declare const empty: () => Interceptors<never, never>

Added in v0.0.1

make

Signature

export declare const make: <E, R>(
  interceptors: Interceptors<E, R>
) => (fetch: Fetch<HttpError>) => Fetch<E | HttpError | core.InterceptorError>

Added in v0.0.1

of

Signature

export declare const of: <E, R>(interceptor: Interceptor<E, R>) => Interceptors<E, R>

Added in v0.0.1

model

Chain (interface)

Signature

export interface Chain {
  request: HttpRequest
  proceed: NextFunction
}

Added in v0.0.1

Interceptor (interface)

Signature

export interface Interceptor<E, R> extends Reader<R | Chain, Promise<Either<E, Response>>> {}

Added in v0.0.1

InterceptorError

Signature

export declare const InterceptorError: typeof core.InterceptorError

Added in v0.0.1

Interceptors (type alias)

Signature

export type Interceptors<E, R> = Array<Interceptor<E, R>>

Added in v0.0.1