Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- landing : Model -> Html Msg
- landing model =
- case model.posts of
- NotAsked ->
- div [] []
- Loading ->
- withLoader (div [] [])
- Success posts ->
- RemoteData.map userHeader model.user
- |> RemoteData.withDefault authHeader
- |> flip layout (landingBody posts)
- Failure err -> error err
- readPost : String -> Model -> Html Msg
- readPost id model =
- case model.posts of
- NotAsked ->
- div [] []
- Loading ->
- withLoader (div [] [])
- Success posts ->
- case List.head <| List.filter (\post -> post.id == id) posts of
- Just post ->
- RemoteData.map userHeader model.user
- |> RemoteData.withDefault authHeader
- |> flip layout (readPostBody post)
- Nothing ->
- error "404 Not Found"
- Failure err -> error err
Add Comment
Please, Sign In to add comment