Skip to content

Instantly share code, notes, and snippets.

@noobymatze
Last active October 25, 2016 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noobymatze/9b80606ccc69ad05e9b368b31532cc03 to your computer and use it in GitHub Desktop.
Save noobymatze/9b80606ccc69ad05e9b368b31532cc03 to your computer and use it in GitHub Desktop.
Break virtual dom on IE 11
{
"version": "1.0.0",
"summary": "helpful summary of your project, less than 80 characters",
"repository": "https://github.com/user/project.git",
"license": "BSD3",
"source-directories": [
"."
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.5 <= v < 5.0.0",
"elm-lang/html": "1.1.0 <= v < 2.0.0"
},
"elm-version": "0.17.1 <= v < 0.18.0"
}
module Main exposing (main)
import Html exposing (Html)
import Html.Attributes as A
import Html.Events as E
import Html.App as App
import Platform.Cmd
type alias Model =
{ name : String
}
init : (Model, Cmd Msg)
init =
( Model ""
, Cmd.none
)
-- UPDATE
type Msg
= UpdateName String
| NoOp
update : Msg -> Model -> (Model, Cmd a)
update msg model =
case msg of
UpdateName name ->
({ model | name = name }, Cmd.none)
NoOp ->
(model, Cmd.none)
-- VIEW
view : Model -> Html Msg
view model =
Html.div
[]
[ Html.input [ A.type' "text", A.value model.name, E.onInput UpdateName ] []
, App.map (always NoOp) <| viewName model.name
]
viewName : String -> Html Never
viewName =
Html.text
main : Program Never
main =
App.program
{ init = init
, update = update
, view = view
, subscriptions = \_ -> Sub.none
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment