Created
December 5, 2018 06:47
-
-
Save jrsinclair/d96f6fee8b69167326e70f2a6af40f2e to your computer and use it in GitHub Desktop.
Elegant Error Handling Code Samples
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
function either(leftFunc, rightFunc, e) { | |
return (e instanceof Left) ? leftFunc(e._value) : rightFunc(e._value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment