Skip to content

Commit

Permalink
🐛 Fix incorrect documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Bryant committed Sep 28, 2021
1 parent f0834ac commit ba14e5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/tutorials/todo-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,18 @@ class TodosBloc(private val todoDao: TodoDao) : Bloc<TodosEvent, TodosState>(Tod
on<TodosInitialized> {
emitEach(todoDao.getAllTodos().map { TodosLoadSuccess(it) })
}
on<TodoAdded> {
on<TodoAdded> { event ->
todoDao.addTodo(Todo(name = event.name))
}
on<TodoCompleted> {
on<TodoCompleted> { event ->
val todo = todoDao.getTodo(event.id)
todoDao.updateTodo(todo.copy(completed = true))
}
on<TodoUncompleted> {
on<TodoUncompleted> { event ->
val todo = todoDao.getTodo(event.id)
todoDao.updateTodo(todo.copy(completed = false))
}
on<TodoDeleted> {
on<TodoDeleted> { event ->
val todo = todoDao.getTodo(event.id)
todoDao.deleteTodo(todo)
}
Expand Down

0 comments on commit ba14e5c

Please sign in to comment.