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

last

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

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

@example
import { last } from "./combinable.ts";
import { pipe } from "./fn.ts";

type Person = { name: string, age: number };

const CombinablePerson = last<Person>();

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

const lastPerson = pipe(
  octavia,
  CombinablePerson.combine(kimbra),
  CombinablePerson.combine(brandon),
); // lastPerson === brandon
function last<A>(): Combinable<A>;
§
last<A>(): Combinable<A>
[src]

§Type Parameters

§Return Type