work on async demo

This commit is contained in:
Greg Johnston 2024-02-17 13:26:08 -05:00
parent 66e1e6d7a1
commit 44a0a0a93a
2 changed files with 6 additions and 11 deletions

View File

@ -30,16 +30,10 @@ pub fn async_example() -> impl IntoView {
let times = move || { let times = move || {
trigger.track(); trigger.track();
async move { async move { (a2.await.to_string(), "test") } //{ (a2.await.to_string(), " and ", b2.await.to_string()) }
view! { .suspend()
{a2.await} .with_fallback("Loading...")
" and " .track()
{b2.await}
}
}
.suspend()
.with_fallback("Loading...")
.track()
}; };
let on_click = move |_| { let on_click = move |_| {
@ -64,7 +58,7 @@ pub fn async_example() -> impl IntoView {
</button> </button>
<p>{move || count.get()}</p> <p>{move || count.get()}</p>
<p> <p>
//{times} {times}
</p> </p>
} }
} }

View File

@ -21,6 +21,7 @@ use std::{
}; };
// any changes here should also be made in src/view/primitives.rs // any changes here should also be made in src/view/primitives.rs
// TODO should also apply to mapped signal read guards
macro_rules! render_primitive { macro_rules! render_primitive {
($($child_type:ty),* $(,)?) => { ($($child_type:ty),* $(,)?) => {
$( $(