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

fromEither

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

Convert an Either to an AsyncEither.

@example
import * as AE from "./async_either.ts";
import * as E from "./either.ts";

const value1 = AE.fromEither(E.right(1));
const value2 = AE.fromEither(E.left("Error!"));

const result1 = await value1(); // Right(1)
const result2 = await value2(); // Left("Error!")
function fromEither<A, B>(ta: Either<B, A>): AsyncEither<B, A>;
§
fromEither<A, B>(ta: Either<B, A>): AsyncEither<B, A>
[src]

§Type Parameters

§Parameters

§Return Type