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

Interceptor overview

Added in v1.0.0


Table of contents


combinators

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 v1.0.0

constructor

copy

Signature

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

Added in v1.4.0

constructors

empty

Signature

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

Added in v1.0.0

make

Creates the intercepting wrapper around the provided platform adapter

Signature

export declare const make: <E, R>(interceptors: Interceptors<E, R>) => Effect<Adapter, E, Exclude<R, Context> | Fetch>

Added in v2.0.0

of

Signature

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

Added in v1.2.0

provide

Provides the given platform adapter to the interceptor Fetch wrapper

Signature

export declare const provide: {
  <E, R>(fetch: Adapter): (interceptor: Effect<Adapter, E, Fetch | R>) => Effect<Adapter, E, Exclude<R, Fetch>>
  <E, R>(interceptor: Effect<Adapter, E, Fetch | R>, fetch: Adapter): Effect<Adapter, E, Exclude<R, Fetch>>
}

Added in v2.0.0

model

Chain (interface)

Signature

export interface Chain {
  request: HttpRequest
  proceed(request: HttpRequest): Effect<Response, HttpError, never>
}

Added in v1.0.0

Interceptor (interface)

Signature

export interface Interceptor<E, R> extends Effect<Response, E, R | Context> {}

Added in v1.2.3

Interceptors (type alias)

Signature

export type Interceptors<E, R> = Chunk.Chunk<Interceptor<E, R>>

Added in v1.2.3

tag

Context (class)

Signature

export declare class Context

Added in v1.0.0