Created
March 14, 2019 19:42
-
-
Save rjhilgefort/d9d520d58816a796aac2b82774991608 to your computer and use it in GitHub Desktop.
This file contains 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
console.clear() | |
const upperAsync = (x) => Promise.resolve(toUpper(x)) | |
const splitChars = split('') | |
const handleResponse = curry((tag, promise) => | |
pipe( | |
then((data) => { | |
console.log(`${tag}-SUCCESS: ${data}`) | |
return data | |
}), | |
otherwise((err) => { | |
console.log(`${tag}-ERROR: ${err.message}`) | |
}) | |
)(promise) | |
) | |
pipe( | |
upperAsync, | |
then(splitChars), | |
// then(() => { throw new Error('Im upset about my liiiiiifffeee') }), | |
then(map(toLower)), | |
then(join('-')), | |
handleResponse('OurPipe'), | |
)('something') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment