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

x/rimbu/common/internal.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.13.0/common/internal.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