Skip to main content
Module

x/rimbu/mod.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.14.0/mod.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