Last active
March 14, 2017 21:37
-
-
Save kingsleyh/8c094accfff98ad6360d60454aef2518 to your computer and use it in GitHub Desktop.
Elm
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
module Boards.Messages exposing (..) | |
type Msg | |
= NoOp |
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
module Boards.View exposing (..) | |
nav : Boards -> Html Msg | |
nav model = | |
Html.map (\_ -> NoOp) (Nav.View.viewNav model.navBar) | |
view : Boards -> Html Msg | |
view model = | |
div [] [ nav model ] |
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
module Messages exposing (..) | |
type Msg | |
= NavMsg Nav.Messages.Msg | |
| BoardsMsg Boards.Messages.Msg |
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
module Update exposing (..) | |
update : Msg -> Model -> ( Model, Cmd Msg ) | |
update msg model = | |
case msg of | |
BoardsMsg subMsg -> | |
let | |
( updatedBoards, cmd) = | |
Boards.Update.update subMsg model.boards | |
in | |
( { model | boards = updatedBoards }, Cmd.batch Cmd.map BoardsMsg cmd) | |
NavMsg subMsg -> | |
let | |
( updatedNav, cmd ) = | |
Nav.Update.update subMsg model.navBar | |
in | |
Debug.log "Nav main update" | |
( { model | navBar = updatedNav }, Cmd.map NavMsg cmd ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment