Replies: 1 comment
-
|
Yeah, doable. Don't try to make let mut expired = use_signal(|| false);
use_future(move || async move {
let ms = /* deadline - now, in milliseconds */;
gloo_timers::future::TimeoutFuture::new(ms as u32).await;
expired.set(true);
});
rsx! {
if !expired() {
button { "Sign up" }
}
}Why
Two things to watch:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a webapp that will let users sign up for meals, but there is a deadline to sign up for each meal. I would like to be able to send a signal when that deadline passes to hide the sign up/cancel buttons without the user having to reload the page. Is this possible? Are there alternative approaches?
I have been trying to find out how to update a
use_server_futureto do this, but I have so far been unable to do this.Beta Was this translation helpful? Give feedback.
All reactions