You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
While working on this PR, I realized I couldn't get the error from the ActionForm's error prop. To give a small snippet:
#[component]fnFoo() -> implIntoView{let error = RwSignal::new(None);Effect::new(move |_| {
logging::log!("{:?}", error.get());// This line will error because get cannot be called for signals with types that don't implement Clone});view!{
<ActionForm action=some_action error=error>
{/* Rest of form */}
</ActionForm>
}}
The type of the error prop is Option<RwSignal<Option<Box<dyn Error>>>>. Since Error isn't constrained by Clone, the compiler will give an error when trying to call get on that RwSignal. Should signals even be able to be set with non-cloneable types in the first place? The Clone constraint exists on SignalGet, but not SignalSet, making it possible to set a value that cannot be gotten.
The text was updated successfully, but these errors were encountered:
.with() can be called on any signal whose value isn't Clone, i.e., error.with(|value| logging::log!("{value:?}"));
We are probably slightly working across each other at this point, as the error signal is being removed on ActionForm in favor of simply using the action's .value() signal, which it currently duplicates (i.e., the Err condition in that signal) #2158
I need to reply to your comments in your PR and will do that soon.
Describe the bug
While working on this PR, I realized I couldn't get the error from the
ActionForm
's error prop. To give a small snippet:The type of the error prop is
Option<RwSignal<Option<Box<dyn Error>>>>
. SinceError
isn't constrained byClone
, the compiler will give an error when trying to callget
on thatRwSignal
. Should signals even be able to be set with non-cloneable types in the first place? TheClone
constraint exists onSignalGet
, but notSignalSet
, making it possible to set a value that cannot be gotten.The text was updated successfully, but these errors were encountered: