mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-22 19:40:14 -04:00
get rid of the last create_effect call
This commit is contained in:
parent
b8b11e07a4
commit
cdf95c5206
@ -48,9 +48,13 @@ pub fn AddRecipe<'ctx, G: Html>(cx: Scope<'ctx>, sh: StateHandler<'ctx>) -> View
|
||||
)
|
||||
});
|
||||
|
||||
// TODO(jwall): This create effect should no longer be necessary;
|
||||
create_effect(cx, move || {
|
||||
create_recipe_signal.track();
|
||||
view! {cx,
|
||||
label(for="recipe_title") { "Recipe Title" }
|
||||
input(bind:value=recipe_title, type="text", name="recipe_title", id="recipe_title", on:change=move |_| {
|
||||
dirty.set(true);
|
||||
})
|
||||
button(on:click=move |_| {
|
||||
create_recipe_signal.trigger_subscribers();
|
||||
if !*dirty.get_untracked() {
|
||||
return;
|
||||
}
|
||||
@ -78,14 +82,6 @@ pub fn AddRecipe<'ctx, G: Html>(cx: Scope<'ctx>, sh: StateHandler<'ctx>) -> View
|
||||
.expect("Unable to navigate to recipe");
|
||||
}
|
||||
});
|
||||
});
|
||||
view! {cx,
|
||||
label(for="recipe_title") { "Recipe Title" }
|
||||
input(bind:value=recipe_title, type="text", name="recipe_title", id="recipe_title", on:change=move |_| {
|
||||
dirty.set(true);
|
||||
})
|
||||
button(on:click=move |_| {
|
||||
create_recipe_signal.trigger_subscribers();
|
||||
}) { "Create" }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user