Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Operate

Index

Constructors

Methods

  • fallback<T, U>(value: U): UnaryFn<T, Fallback<T, U>>
  • For an input of a result or null, the returning function returns the result if not null, or a successful result of value if null.

    Type Parameters

    • T extends Break<any, any>

    • U

    Parameters

    • value: U

    Returns UnaryFn<T, Fallback<T, U>>

  • flip<T, U, V>(onSuccess?: U, onFailure?: V): UnaryFn<T, Flip<T, U, V>>
  • Allows to optionally convert an input successful result into a failed Result with the same data, and vice-versa.

    Type Parameters

    • T extends Break<any, any>

    • U extends boolean | Empty

    • V extends boolean | Empty

    Parameters

    • Optional onSuccess: U

      whether to flip a successful result to a failed result

    • Optional onFailure: V

      whether to flip a failed result to a successful result

    Returns UnaryFn<T, Flip<T, U, V>>

  • map<T, U, V>(onSuccess?: U, onFailure?: V): UnaryFn<T, Map<T, U, V>>
  • Maps a result to a result with different data values.

    Type Parameters

    Parameters

    • Optional onSuccess: U
    • Optional onFailure: V

    Returns UnaryFn<T, Map<T, U, V>>

  • tap<T>(onSuccess?: Empty | UnaryFn<SuccessType<T>, void>, onFailure?: Empty | UnaryFn<FailureType<T>, void>): UnaryFn<T, T>
  • Allows for the execution of side effects upon a successful or failed result.

    Type Parameters

    • T extends Break<any, any>

    Parameters

    • Optional onSuccess: Empty | UnaryFn<SuccessType<T>, void>
    • Optional onFailure: Empty | UnaryFn<FailureType<T>, void>

    Returns UnaryFn<T, T>

  • Maps a result to their data, with optional remaps for data upon a successful and/or failed result.

    Type Parameters

    Parameters

    Returns UnaryFn<T, Transform<T, U | V>>

Generated using TypeDoc