Last active
June 16, 2017 01:29
-
-
Save joeyfigaro/10f7c778ee83f10e799df432864810bb to your computer and use it in GitHub Desktop.
Ramda Composition Example
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
const props = ['users', 'lessons', 'favorites', 'history']; | |
const selectProps = pick(props); | |
const stringify = compose( | |
JSON.stringify, | |
selectProps | |
); | |
stringify({ | |
sensitive: { | |
hash: '!asdf#@hfASH234hdASHg1g1', | |
password: '*#YH!@G$**' | |
}, | |
users: [ | |
{ name: 'Joey', email: '[email protected]' }, | |
{ name: 'Richard', email: '[email protected]' } | |
], | |
lessons: [ | |
{ name: 'function composition', favorites: 532, date_published: 'Thu Jun 15 2017 21:20:11 GMT-0400 (EDT)' } | |
] | |
}); | |
// -> "{\"users\":[{\"name\":\"Joey\",\"email\":\"[email protected]\"},{\"name\":\"Richard\",\"email\":\"[email protected]\"}],\"lessons\":[{\"name\":\"function composition\",\"favorites\":532,\"date_published\":\"Thu Jun 15 2017 21:20:11 GMT-0400 (EDT)\"}]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment