Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- INIT
- init : Model
- init =
- { content = "" }
- -- UPDATE
- type Msg
- = Change String
- update : Msg -> Model -> Model
- update msg model =
- case msg of
- Change newContent ->
- { model | content = newContent }
- -- VIEW
- view : Model -> Html Msg
- view model =
- div []
- [ input [ placeholder "Text to reverse", value model.content, onInput Change ] []
- , div [] [ text (String.reverse model.content) ]
- ]
Add Comment
Please, Sign In to add comment