Skip to content

Instantly share code, notes, and snippets.

@orbitbot
Created January 11, 2017 21:44
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 orbitbot/10f841cfc65f7c743ebb7e07d4cf8b14 to your computer and use it in GitHub Desktop.
Save orbitbot/10f841cfc65f7c743ebb7e07d4cf8b14 to your computer and use it in GitHub Desktop.
Set object property util, for convenience with mithril.js m.withAttr
const set = (obj, prop, modify = (v) => v) => (value) => obj[prop] = modify(value)
exports default set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment