Skip to content

Instantly share code, notes, and snippets.

@gemmadlou
Last active September 30, 2016 12:06
Show Gist options
  • Save gemmadlou/a9d3bb00fccb41a9c8406f2fb52a91ff to your computer and use it in GitHub Desktop.
Save gemmadlou/a9d3bb00fccb41a9c8406f2fb52a91ff to your computer and use it in GitHub Desktop.
Dictionary Model
// 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