TodoStore.__onDispatch = function(payload){ switch (payload.actionType) { case TodoConstants.RECEIVE_TODOS: TodoStore.resetTodos(payload.response); TodoStore.__emitChange(); break; case TodoConstants.RECEIVE_ONE_TODO: TodoStore.updateOneTodo(payload.response); TodoStore.__emitChange(); break; case TodoConstants.ADD_ONE_TODO: TodoStore.addOneTodo(payload.response); TodoStore.__emitChange(); break; case TodoConstants.DELETE_ONE_TODO: TodoStore.deleteTodo(payload.response); TodoStore.__emitChange(); break; case TodoConstants.RECEIVE_ONE_TODO_LIST: TodoStore.addOneTodoList(payload.todoList); TodoStore.__emitChange(); break; case TodoConstants.REMOVE_TODO_LIST: TodoStore.removeList(payload.todoList); TodoStore.__emitChange(); break; } };