Function reject

Standalone function version of Task.reject

  • Construct a Task which is already rejected. Useful when you have an error already, but need it to be available in an API which expects a Task.

    Type Parameters

    • T = never
    • E extends {} = {}

    Returns Task<T, Unit>

  • Construct a Task which is already rejected. Useful when you have an error already, but need it to be available in an API which expects a Task.

    Type Parameters

    • T = never
    • E = unknown

    Parameters

    • reason: E

    Returns Task<T, E>