{"action":"closed","issue":{"url":"https://api.github.com/repos/halfzebra/create-elm-app/issues/97","repository_url":"https://api.github.com/repos/halfzebra/create-elm-app","labels_url":"https://api.github.com/repos/halfzebra/create-elm-app/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/halfzebra/create-elm-app/issues/97/comments","events_url":"https://api.github.com/repos/halfzebra/create-elm-app/issues/97/events","html_url":"https://github.com/halfzebra/create-elm-app/issues/97","id":206424072,"number":97,"title":"Hotloading fails to retain state after compile error","user":{"login":"simonh1000","id":5256724,"avatar_url":"https://avatars2.githubusercontent.com/u/5256724?v=3","gravatar_id":"","url":"https://api.github.com/users/simonh1000","html_url":"https://github.com/simonh1000","followers_url":"https://api.github.com/users/simonh1000/followers","following_url":"https://api.github.com/users/simonh1000/following{/other_user}","gists_url":"https://api.github.com/users/simonh1000/gists{/gist_id}","starred_url":"https://api.github.com/users/simonh1000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonh1000/subscriptions","organizations_url":"https://api.github.com/users/simonh1000/orgs","repos_url":"https://api.github.com/users/simonh1000/repos","events_url":"https://api.github.com/users/simonh1000/events{/privacy}","received_events_url":"https://api.github.com/users/simonh1000/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-02-09T07:15:23Z","updated_at":"2017-04-12T08:11:21Z","closed_at":"2017-04-12T08:11:21Z","body":"I changed the example code to the following, click Add 1 a few times and then made a change to force a compile error, and then corrected it. State returned to 1\r\n\r\n\r\n```\r\nmodule App exposing (..)\r\n\r\nimport Html exposing (Html, text, div, img, button)\r\nimport Html.Attributes exposing (src)\r\nimport Html.Events exposing (..)\r\n\r\n\r\ntype alias Model =\r\n    { message : String\r\n    , logo : String\r\n    , count : Int\r\n    }\r\n\r\n\r\ninit : String -> ( Model, Cmd Msg )\r\ninit path =\r\n    ( { message = \"Your Elm App is working!\", logo = path, count = 1 }, Cmd.none )\r\n\r\n\r\ntype Msg\r\n    = Inc\r\n    | NoOp\r\n\r\n\r\nupdate : Msg -> Model -> ( Model, Cmd Msg )\r\nupdate msg model =\r\n    case msg of\r\n        Inc ->\r\n            { model | count = model.count + 1 } ! []\r\n\r\n        _ ->\r\n            model ! []\r\n\r\n\r\nview : Model -> Html Msg\r\nview model =\r\n    div []\r\n        [ img [ src model.logo ] []\r\n        , div [] [ text model.message ]\r\n        , div [] [ text <| toString model.count ]\r\n        , button [ onClick Inc ] [ text \"add 1\" ]\r\n        ]\r\n\r\n\r\nsubscriptions : Model -> Sub Msg\r\nsubscriptions model =\r\n    Sub.none\r\n\r\n```"}}
{"actor":{"display_login":"halfzebra"}}