Created
April 21, 2016 23:14
-
-
Save chuck0523/831f9728e9498357a584967f9a30e599 to your computer and use it in GitHub Desktop.
This file contains 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
update : Action -> Model -> Model | |
update action model = | |
case action of | |
Add -> | |
let newTodo = ( model.nextID, Todo.init model.nextID model.addText ) | |
newTodos = model.todos ++ [ newTodo ] | |
in | |
{ model | | |
todos = newTodos, | |
nextID = model.nextID + 1, | |
addText = "" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment