Created
July 21, 2019 01:00
-
-
Save Javiani/ade3e032d7dc43448a1c09074feb566d to your computer and use it in GitHub Desktop.
Snippets for Medium
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
const lastname = Maybe(() => data.personsLastName[1].value) | |
.catch( _ => 'Lastname' ) | |
const fullname = firstname | |
.then( fname => middleName.then( mname => `${fname} ${mname}`) ) | |
.then( name => lastname.then( lname => `${name} ${lname}` ) ) | |
// 'Marcus Geoffrey Lastname' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment