Created
November 15, 2017 17:29
-
-
Save RobertFischer/670637f07e26aad6da0f39e928d8e58c to your computer and use it in GitHub Desktop.
The goal is to get a MilestonesMsg created from a GlobalModel instance.
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
milestoneBtnMsg = | |
global.selectedCareplan -- Start with the careplan | |
|> Maybe.andThen .id -- Call .id on it if it's Just; return Nothing if it's Nothing or id is Nothing | |
|> Maybe.map MilestonesRoute -- Wrap it in a MilestonesRoute if we have a Just | |
|> Maybe.withDefault DoNothing -- If we have a Nothing, return DoNothing; otherwise, return the value in the Just | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment