Created
July 21, 2016 09:53
-
-
Save jadehopepunk/7a3b6c6b52d1ce7f5864589ca2f7fc30 to your computer and use it in GitHub Desktop.
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
module PersonRow exposing (..) | |
import Html exposing (..) | |
import Html.App as App | |
import WeekButtons | |
-- MODEL | |
type alias Model = { | |
week: WeekButtons.Model | |
} | |
init : (Model, Cmd Msg) | |
init = | |
( | |
{ | |
week = WeekButtons.init | |
}, | |
Cmd.none | |
) | |
-- UPDATE | |
type Msg = | |
CurrentWeek WeekButtons.Msg | |
update : Msg -> Model -> (Model, Cmd Msg) | |
update action model = | |
case action of | |
CurrentWeek msg -> | |
let | |
(updatedWeek, weekCmds) = | |
WeekButtons.update msg model.week | |
in | |
( | |
{ model | week = updatedWeek}, | |
Cmd.map CurrentWeek weekCmds | |
) | |
-- VIEW | |
view : Model -> Html Msg | |
view model = | |
div [] [ | |
span [] [ text "Craig A." ], | |
App.map CurrentWeek (WeekButtons.view model.week) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment