Guest User

Untitled

a guest
Nov 15th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. -- INIT
  2. init : Model
  3. init =
  4. { content = "" }
  5.  
  6.  
  7. -- UPDATE
  8. type Msg
  9. = Change String
  10. update : Msg -> Model -> Model
  11. update msg model =
  12. case msg of
  13. Change newContent ->
  14. { model | content = newContent }
  15.  
  16.  
  17. -- VIEW
  18. view : Model -> Html Msg
  19. view model =
  20. div []
  21. [ input [ placeholder "Text to reverse", value model.content, onInput Change ] []
  22. , div [] [ text (String.reverse model.content) ]
  23. ]
Add Comment
Please, Sign In to add comment