Skip to main content
cngx-src documentation

setEqual

Functionutils

projects/utils/equality.ts

Description#

Shallow structural equality for two readonly Sets. Returns true when both sets reference the same object, or when they have the same size and every element of a is present in b. Element comparison uses Set.has (SameValueZero semantics).

Intended as an equal arg for computed() / linkedSignal returning ReadonlySet<T>, so consumers downstream do not re-render when the computed re-runs but produces the same element set.

Signature#

setEqual(a: ReadonlySet, b: ReadonlySet)

Parameters#

@paramaReadonlySet
@parambReadonlySet

Returns#

boolean