method Task.prototype.tryFlatMap
Task.prototype.tryFlatMap<
U,
F,
>
(
fn: (value: T) => Task<U, F>,
errFn: (error: unknown) => Promisable<U>,
): Task<U, E>

Chains another task based on the successful value, with error handling for the mapper. If the mapper fails, errFn can recover by returning a success value.

Type Parameters

Parameters

fn: (value: T) => Task<U, F>
errFn: (error: unknown) => Promisable<U>

Return Type

Task<U, E>

Usage

import { Task } from ".";