Skip to main content
Module

x/rimbu/mod.ts>Comp.createValueOfComp

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function Comp.createValueOfComp
import { Comp } from "https://deno.land/x/rimbu@0.13.1/mod.ts";
const { createValueOfComp } = Comp;

Returns a Comp instance that orders objects with a valueOf method according to the given valueComp instance for the valueOf values.

Type Parameters

T extends { valueOf(): V; }
V

Parameters

cls: { new (): T; }
  • the constructor of the values the Comp instance can compare
optional
valueComp: Comp<V> = [UNSUPPORTED]
  • (optional) the Comp instance to use on the .valueOf values