Skip to content

Instantly share code, notes, and snippets.

@loke-dev
Created February 6, 2018 12:28
Show Gist options
  • Save loke-dev/63b9ef894a7e9d8adfc7ee32e87ddeea to your computer and use it in GitHub Desktop.
Save loke-dev/63b9ef894a7e9d8adfc7ee32e87ddeea to your computer and use it in GitHub Desktop.
Object stuff
_extractSummary(events, keys) {
const extract = () => keys.reduce((obj, key) => (obj[key]=events[key], obj), {})
return keys.map(e => ({ type: e, value: extract(events, keys)[e] }));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment