/** biome-ignore-all lint/complexity/useArrowFunction: necessary for class prototypes */ import { type Equivalence, Function, Predicate } from "effect" import * as React from "react" import type * as Component from "./Component.js" export const TypeId: unique symbol = Symbol.for("@effect-fc/Memoized/Memoized") export type TypeId = typeof TypeId export interface Memoized
extends MemoizedOptions
{ readonly [TypeId]: TypeId } export interface MemoizedOptions
{ readonly propsEquivalence?: Equivalence.Equivalence
} export const MemoizedPrototype = Object.freeze({ [TypeId]: TypeId, transformFunctionComponent
( this: Memoized
, f: React.FC
,
) {
return React.memo(f, this.propsEquivalence)
},
} as const)
export const isMemoized = (u: unknown): u is Memoized