Replacing with_slice with lock_slice
This commit is contained in:
parent
f6445756d0
commit
bfd990c12e
|
@ -249,11 +249,13 @@ fn main() {
|
||||||
event(clone!(state => move |event: ChangeEvent| {
|
event(clone!(state => move |event: ChangeEvent| {
|
||||||
let checked = !get_checked(&event);
|
let checked = !get_checked(&event);
|
||||||
|
|
||||||
state.todo_list.with_slice(|todo_list| {
|
{
|
||||||
|
let todo_list = state.todo_list.lock_slice();
|
||||||
|
|
||||||
for todo in todo_list.iter() {
|
for todo in todo_list.iter() {
|
||||||
todo.completed.set(checked);
|
todo.completed.set(checked);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
state.serialize();
|
state.serialize();
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in New Issue