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

premap

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

Derives an instance of Sortable by take an existing Sortable over D and a function that turns an L into D and returns an Sortable over L.

@example
import { premap } from "./sortable.ts";
import { SortableNumber } from "./number.ts";
import { pipe } from "./fn.ts";

// Use number ordering, turn date into number and premap
const date = pipe(
  SortableNumber,
  premap((d: Date) => d.valueOf()),
);
function premap<L, D>(fld: (l: L) => D): ({ sort }: Sortable<D>) => Sortable<L>;
§
premap<L, D>(fld: (l: L) => D): ({ sort }: Sortable<D>) => Sortable<L>
[src]

§Type Parameters

§Parameters

§
fld: (l: L) => D
[src]

§Return Type

§
({ sort }: Sortable<D>) => Sortable<L>
[src]