Skip to content

Instantly share code, notes, and snippets.

@maximLyakhov
Created August 10, 2021 13:45
Show Gist options
  • Save maximLyakhov/31d29ebe593984955724bc183aa72e03 to your computer and use it in GitHub Desktop.
Save maximLyakhov/31d29ebe593984955724bc183aa72e03 to your computer and use it in GitHub Desktop.
pick only updated properties
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