Last active
November 23, 2016 02:21
-
-
Save o0/7028a339e27a292d075d1be9b1b823cb to your computer and use it in GitHub Desktop.
Maybe monad. Requires monet.js library
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 user = { | |
lang: { | |
current: 'ru' | |
} | |
}; | |
const userDefaultLang = Maybe | |
.fromNull(user.lang.default) | |
.orElse(Some('en')) | |
.val; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment