Open
Description
Enhancement request:
custom equals
allow .equals
to accept a callback, for example:
const x = Map({a: 1, b:2})
const y = Map({a:1, b:5})
x.equals(y, (x, y) => x.get("a") === y.get("a"));
Consider the above for more complex structures such as Immutable Records, it would be helpful to be able to compare only certain fields within a collection. Sometimes, API responses may not be in the exact same shape as data stored in client state, and populating the immutable structures with these data that just have minor discrepancies causes .equals()
to return false, when really we are interested in only certain fields.
Any thoughts on this? ^
Metadata
Metadata
Assignees
Labels
No labels