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

utils overview

Utility functions

Added in v0.0.1


Table of contents


utils

IBatchRequest (interface)

Signature

export interface IBatchRequest {
  method: xhrMeth
  path: string
  body?: any
}

Added in v0.0.1

IBatchResponse (interface)

Signature

export interface IBatchResponse {
  total: number
  successful: number
  failed: number
  responses: Array<{ code: number; body: any }>
}

Added in v0.0.1

cleanedUpAxiosError

Signature

export declare const cleanedUpAxiosError: <T>(err: AxiosError<T, any>) => AxiosError<T, any>

Added in v0.0.1

fpAxios

Signature

export declare const fpAxios: <T = any>(
  options: AxiosRequestConfig
) => (url: string) => TE.TaskEither<AxiosError<T, any>, AxiosResponse<T, any>>

Added in v0.0.1

mlBatch

Signature

export declare const mlBatch: (opts: IRequestOpts, apiUrl: string) => E.Either<Error, IBatchRequest>

Added in v0.0.1

mlRequest

Signature

export declare const mlRequest: <TRes>(
  opts: IRequestOpts,
  apiUrl: string
) => RTE.ReaderTaskEither<MlEnv, AxiosError<TRes, any>, TRes>

Added in v0.0.1

runBatch

Signature

export declare const runBatch: (
  reqs: Array<IBatchRequest>
) => RTE.ReaderTaskEither<MlEnv, AxiosError<IBatchResponse, any>, IBatchResponse>

Added in v0.0.1

xhrMeth (type alias)

Signature

export type xhrMeth = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'

Added in v0.0.1