Simplify TodoMVC example (#2935)

* Remove id field from TodoItem

* Remove derived traits from TodoItem
This commit is contained in:
Matt Hunzinger 2024-09-12 20:51:42 -04:00 committed by GitHub
parent 37d5f93c21
commit 2733497038
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,9 +16,7 @@ enum FilterState {
Completed,
}
#[derive(Debug, PartialEq, Eq)]
struct TodoItem {
id: u32,
checked: bool,
contents: String,
}
@ -120,7 +118,6 @@ fn TodoHeader(mut todos: Signal<HashMap<u32, TodoItem>>) -> Element {
if evt.key() == Key::Enter && !draft.read().is_empty() {
let id = todo_id();
let todo = TodoItem {
id,
checked: false,
contents: draft.to_string(),
};