Skip to content

Instantly share code, notes, and snippets.

View steinathan's full-sized avatar
🏠
Fullstack dev; working from home

Nathan steinathan

🏠
Fullstack dev; working from home
  • Global
View GitHub Profile
// Deep-merges arrays without duplicate values
const mergeCustomizer = (objValue: any, srcValue: any) => {
if (Array.isArray(objValue) && Array.isArray(srcValue)) {
return uniqWith(
[...srcValue, ...objValue],
(a, b) => a === b || isEqual(a, b),
);
}
};