Published
Edited
Jul 14, 2020
Insert cell
Insert cell
Insert cell
Insert cell
getDifference = (original, incoming) => {
const flatOriginal = flat(original);
const flatIncoming = flat(incoming);

const differenceKeys = Object.keys(flatIncoming).filter(
// using R.equals for value equality instead of reference.
key => !R.equals(flatOriginal[key], flatIncoming[key])
);

return flat.unflatten(R.pick(differenceKeys, flatIncoming));
}
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more