Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/common/index.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@1.0.2/common/index.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