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

first

import { first } from "https://raw.githubusercontent.com/baetheus/fun/main/combinable.ts";

Get an Combinable over A that always returns the first parameter supplied to combine (confusingly this is actually the last parameter since combine is in curried form).

@example
import { first, getCombineAll } from "./combinable.ts";
import { pipe } from "./fn.ts";

type Person = { name: string, age: number };
const FirstPerson = first<Person>();
const getFirstPerson = getCombineAll(FirstPerson);

const octavia: Person = { name: "Octavia", age: 42 };
const kimbra: Person = { name: "Kimbra", age: 32 };
const brandon: Person = { name: "Brandon", age: 37 };

const result = getFirstPerson(octavia, kimbra, brandon); // octavia
function first<A>(): Combinable<A>;
§
first<A>(): Combinable<A>
[src]

§Type Parameters

§Return Type