replaceEqualDeep
Structural sharing - returns
next
with every part that is deeply equal to
prev
replaced by the
prev
reference.
When both values are deeply equal the
prev
reference is returned, so consumers can rely on
===
checks.
Only plain objects and arrays are traversed, other values are compared with
Object.is
.
Import
import { replaceEqualDeep } from "@hyper-fetch/core"
Source
Package
Parameters
replaceEqualDeep<T>(prev: unknown, next: T)
Parameters
| Name | Type | Description |
|---|---|---|
| prev | | previous value |
| next | | incoming value |
Returns
next
sharing unchanged references with
prev
T

