Created
March 23, 2018 16:13
-
-
Save mosesoak/626d256c63a0d29e338c7e125aa989f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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), | |
); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment