Skip to content

Instantly share code, notes, and snippets.

@perguth
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perguth/1084d69e3afac97d4e18 to your computer and use it in GitHub Desktop.
Save perguth/1084d69e3afac97d4e18 to your computer and use it in GitHub Desktop.
Merge all objects but ignore falsy values. See: https://speakerdeck.com/vjeux/react-css-in-js @react, @css
function m(...args) {
let res = {}
for (let i = 0; i < args.length; ++i)
if (args[i]) Object.assign(res, args[i])
return res
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment