import { sortable } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { premap } = sortable;
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.
Examples
Example 1
Example 1
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()),
);