Last active
September 30, 2016 12:06
-
-
Save gemmadlou/a9d3bb00fccb41a9c8406f2fb52a91ff to your computer and use it in GitHub Desktop.
Dictionary Model
This file contains hidden or 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
// Dependency on Rambda | |
var Person = (properties) => { | |
return R.pick(['firstname', 'lastname', 'email'], properties); | |
} | |
var G = Person({firstname:'Gemma', lastname: 'Black', email: 'gbabc.com'}); | |
var User = { | |
business: (properties) => { | |
properties.type = 'business'; | |
return R.pick(['type', 'email'], properties); | |
} | |
} | |
var Google = User.business({email: '[email protected]'}) | |
console.clear(); | |
console.log('1pp', G, Google); | |
//http://tech.transferwise.com/how-to-create-data-model-objects-in-javascript/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment