Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

References

CancellationError

Re-exports CancellationError

Fiber

Re-exports Fiber

Ref

Re-exports Ref

TimeoutError

Re-exports TimeoutError

default

Renames and re-exports IO

Type aliases

IO

IO<A, E>: IOBase<A, E>

This is the primary type in the library. It represents an action which returns a value of type A, or raises an error of type E. The action may perform side effects and wait asynchronously. Any asynchronous or impure function should return this type.

Type parameters

  • A

    the type of values returned by this action.

  • E = unknown

    the type of errors raised by this action.

Outcome

Outcome<A, E>: { kind: Succeeded; value: A } | { kind: Raised; value: E } | { kind: Canceled }

An object containing the result of running an action (IO). It will either have succeeded with a value of type A, raise an error of type E, or been canceled, in which case it will not contain a value.

Type parameters

  • A

    the type of values returned if the action succeeds.

  • E

    the type of errors raised if the action fails.

RetryOptions

RetryOptions<E>: { backoff?: number; count: number; delay?: Duration; filter?: any }

Options for controlling the behaviour of the retry method.

Type parameters

  • E = unknown

Type declaration

  • Optional backoff?: number

    The factor to multiply the delay by after each failed attempt.

  • count: number

    The number of times to retry.

  • Optional delay?: Duration

    The time to wait after each failed attempt before retrying.

  • filter?:function
    • filter(error: E): boolean
    • A predicate which will be called to decide whether a raised error should be retried.

      Parameters

      • error: E

      Returns boolean

Variables

Outcome

Outcome: { Canceled: { kind: Canceled }; Raised: any; Succeeded: any; toIO: any }

Type declaration

RetryOptions

RetryOptions: { defaults: Omit<Required<RetryOptions<unknown>>, "count"> }

Type declaration

Functions

IO

  • IO<A>(effect: () => A | Promise<A>): IO<A, unknown>
  • Type parameters

    • A

    Parameters

    • effect: () => A | Promise<A>
        • (): A | Promise<A>
        • Returns A | Promise<A>

    Returns IO<A, unknown>

Generated using TypeDoc