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

apply

import { apply } 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.

@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.apply(asyncEitherValue),
);

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

§Type Parameters

§Parameters

§Return Type

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