Created
August 10, 2021 13:45
-
-
Save maximLyakhov/31d29ebe593984955724bc183aa72e03 to your computer and use it in GitHub Desktop.
pick only updated properties
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
export default function pickUpdatedProperties(current: any, sent: any) { | |
for (const key in current) { | |
if (current[key] && sent[key] && String(current[key]) === String(sent[key])) { | |
delete sent[key]; | |
} | |
} | |
return sent; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment