Skip to content

Instantly share code, notes, and snippets.

@grrinchas
Last active December 25, 2017 13:23
Show Gist options
  • Save grrinchas/fae06a57401e617f2c31e0ce41fd43ea to your computer and use it in GitHub Desktop.
Save grrinchas/fae06a57401e617f2c31e0ce41fd43ea to your computer and use it in GitHub Desktop.
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