Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

mapSecond

import { mapSecond } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/async_either.ts";

Apply a function to the Left value of an AsyncEither.

@example
import * as AE from "./async_either.ts";
import { pipe } from "./fn.ts";

const result = pipe(
  AE.left("error"),
  AE.mapSecond(e => `Error: ${e}`)
);

const value = await result(); // Left("Error: error")
function mapSecond<B, J>(fbj: (b: B) => J): <A>(ta: AsyncEither<B, A>) => AsyncEither<J, A>;
§
mapSecond<B, J>(fbj: (b: B) => J): <A>(ta: AsyncEither<B, A>) => AsyncEither<J, A>
[src]

§Type Parameters

§Parameters

§
fbj: (b: B) => J
[src]

§Return Type

§
<A>(ta: AsyncEither<B, A>) => AsyncEither<J, A>
[src]