Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created April 23, 2016 01:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Add ->
let newTodo = ( model.nextID, Todo.init model.nextID model.addText )
newTodos = model.todos ++ [ newTodo ]
newModel = if model.addText == "" then model else { model |
todos = newTodos,
nextID = model.nextID + 1,
addText = ""
}
in
newModel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment