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

applySequential

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

Apply a function wrapped in an AsyncEither to a value wrapped in an AsyncEither, sequentially.

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

const asyncEitherFn = AE.right((n: number) => n * 2);
const asyncEitherValue = AE.right(5);

const result = pipe(
  asyncEitherFn,
  AE.applySequential(asyncEitherValue)
);

const value = await result(); // Right(10)
function applySequential<A, B>(ua: AsyncEither<B, A>): <I, J = never>(ufai: AsyncEither<J, (a: A) => I>) => AsyncEither<B | J, I>;
§
applySequential<A, B>(ua: AsyncEither<B, A>): <I, J = never>(ufai: AsyncEither<J, (a: A) => I>) => AsyncEither<B | J, I>
[src]

§Type Parameters

§Parameters

§Return Type

§
<I, J = never>(ufai: AsyncEither<J, (a: A) => I>) => AsyncEither<B | J, I>
[src]