Last active
December 25, 2017 13:23
-
-
Save grrinchas/fae06a57401e617f2c31e0ce41fd43ea 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
landing : Model -> Html Msg | |
landing model = | |
RemoteData.map userHeader model.user | |
|> RemoteData.withDefault authHeader | |
|> flip layout (landingBody model.posts) | |
readPost : String -> Model -> Html Msg | |
readPost id model = | |
case List.head <| List.filter (\post -> post.id == id) model.posts of | |
Just post -> | |
RemoteData.map userHeader model.user | |
|> RemoteData.withDefault authHeader | |
|> flip layout (readPostBody post) | |
Nothing -> | |
error "404 Not Found" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment