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

x/rimbu/common/index.ts>Comp.toEq

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

Returns an Eq equality instance thet will return true when the given comp comparable instance returns 0.

Examples

Example 1

const eq = Comp.toEq(Comp.objectComp())
console.log(eq({ a: 1, b: 2 }, { b: 2, a: 1 }))
// => true

Parameters

comp: Comp<T>
  • the Comp comparable instance to convert