Open luveti opened 1 month ago
Poking around a bit, it looks like using the following works:
pub fn app() -> Element {
let mut num = use_server_future(get_next_number);
rsx! {
div {
onclick: move |e| async move {
queue_effect(move || {
if let Some(num) = &mut num {
num.restart();
}
});
},
if let Some(num) = num {
match num.value().as_ref() {
Some(num) => match num.as_ref() {
Ok(num) => rsx! { p { "Next number is {num}" } },
Err(e) => rsx! { p { "Loading next number failed, {e}" } },
},
None => rsx! { p { "Loading..." } }
}
}
}
}
}
Is this the recommended work around? If so, this may be a nice addition to the Event Handlers page.
Environment:
Questionnaire