Last active
February 7, 2018 11:16
-
-
Save isnifer/42a1eb745b2ce10f7c83bfb44dab0423 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
import { filter, union, keys } from 'lodash' | |
function changedKeys(o1, o2) { | |
return filter(union(keys(o1), keys(o2)), key => o1[key] !== o2[key]).map(key => ({ | |
[key]: { | |
prev: o1[key], | |
next: o2[key], | |
}, | |
})) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment