simplify fullstack hello world examples

This commit is contained in:
Evan Almloff committed 2023-07-19 16:57:43 -07:00
1 parent 6ade4767e6
commit f55375b8ce
3 files changed
+6 -24

No files matched your search

@@ -22,14 +22,8 @@ fn app(cx: Scope<AppProps>) -> Element {
}
fn Child(cx: Scope) -> Element {
let state = use_server_future(cx, (), |()| async move {
loop {
if let Ok(res) = get_server_data().await {
break res;
}
}
})?
.value();
let state =
use_server_future(cx, (), |()| async move { get_server_data().await.unwrap() })?.value();
let mut count = use_state(cx, || 0);
let text = use_state(cx, || "...".to_string());
@@ -22,14 +22,8 @@ fn app(cx: Scope<AppProps>) -> Element {
}
fn Child(cx: Scope) -> Element {
let state = use_server_future(cx, (), |()| async move {
loop {
if let Ok(res) = get_server_data().await {
break res;
}
}
})?
.value();
let state =
use_server_future(cx, (), |()| async move { get_server_data().await.unwrap() })?.value();
let mut count = use_state(cx, || 0);
let text = use_state(cx, || "...".to_string());
@@ -22,14 +22,8 @@ fn app(cx: Scope<AppProps>) -> Element {
}
fn Child(cx: Scope) -> Element {
let state = use_server_future(cx, (), |()| async move {
loop {
if let Ok(res) = get_server_data().await {
break res;
}
}
})?
.value();
let state =
use_server_future(cx, (), |()| async move { get_server_data().await.unwrap() })?.value();
let mut count = use_state(cx, || 0);
let text = use_state(cx, || "...".to_string());