Skip to main content
Module

x/rimbu/mod.ts>Comp.invert

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

Returns a Comp instance the reverses the order of the given comp instance.

Examples

Example 1

const c = Comp.invert(Comp.numberComp())
console.log(c.compare(3, 5) > 0)
// => true
console.log(c.compare(5, 5))
// => 0

Parameters

comp: Comp<T>
  • the Comp instance to wrap