 
   actions =
 
+    # Creates a new todo to database, and updates UI on success.
     addTodo:    (content) ->
       params = todo:
                  content: content

        console.error textStatus, errorThrown.toString()

    toggleTodo: (id, completed) ->
      @dispatch(constants.TOGGLE_TODO, id: id, completed: completed)

    updateTodo: (id, new_content) ->
      @dispatch(constants.UPDATE_TODO, id: id, new_content: new_content)

      @emit('change')

    onToggleTodo: (payload) ->
      @todos[payload.id].completed = payload.completed
      @emit('change')

    onUpdateTodo: (payload) ->
      params = todo:
