feat: amazingly awesome error handling

This commit is contained in:
Jonathan Kelley committed 2021-07-18 12:39:32 -04:00
1 parent 05c909f320
commit 4a72b3140b
58 files changed
+248 -1219

No files matched your search

+4 -4
View File
@@ -28,7 +28,7 @@ pub struct TodoItem {
// =======================
// Components
// =======================
pub fn App(cx: Context<()>) -> VNode {
pub fn App(cx: Context<()>) -> DomTree {
cx.render(rsx! {
div {
id: "app"
@@ -53,7 +53,7 @@ pub fn App(cx: Context<()>) -> VNode {
})
}
pub fn TodoList(cx: Context<()>) -> VNode {
pub fn TodoList(cx: Context<()>) -> DomTree {
let (draft, set_draft) = use_state_classic(cx, || "".to_string());
let (todos, set_todos) = use_state_classic(cx, || HashMap::<uuid::Uuid, Rc<TodoItem>>::new());
let (filter, set_filter) = use_state_classic(cx, || FilterState::All);
@@ -102,7 +102,7 @@ pub struct TodoEntryProps {
item: Rc<TodoItem>,
}
pub fn TodoEntry(cx: Context<TodoEntryProps>) -> VNode {
pub fn TodoEntry(cx: Context<TodoEntryProps>) -> DomTree {
let (is_editing, set_is_editing) = use_state_classic(cx, || false);
let contents = "";
let todo = TodoItem {
@@ -128,7 +128,7 @@ pub fn TodoEntry(cx: Context<TodoEntryProps>) -> VNode {
))
}
pub fn FilterToggles(cx: Context<()>) -> VNode {
pub fn FilterToggles(cx: Context<()>) -> DomTree {
let toggles = [
("All", "", FilterState::All),
("Active", "active", FilterState::Active),