simplify fullstack hello world examples
This commit is contained in:
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 {
|
fn Child(cx: Scope) -> Element {
|
||||||
let state = use_server_future(cx, (), |()| async move {
|
let state =
|
||||||
loop {
|
use_server_future(cx, (), |()| async move { get_server_data().await.unwrap() })?.value();
|
||||||
if let Ok(res) = get_server_data().await {
|
|
||||||
break res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})?
|
|
||||||
.value();
|
|
||||||
|
|
||||||
let mut count = use_state(cx, || 0);
|
let mut count = use_state(cx, || 0);
|
||||||
let text = use_state(cx, || "...".to_string());
|
let text = use_state(cx, || "...".to_string());
|
||||||
|
|||||||
@@ -22,14 +22,8 @@ fn app(cx: Scope<AppProps>) -> Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn Child(cx: Scope) -> Element {
|
fn Child(cx: Scope) -> Element {
|
||||||
let state = use_server_future(cx, (), |()| async move {
|
let state =
|
||||||
loop {
|
use_server_future(cx, (), |()| async move { get_server_data().await.unwrap() })?.value();
|
||||||
if let Ok(res) = get_server_data().await {
|
|
||||||
break res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})?
|
|
||||||
.value();
|
|
||||||
|
|
||||||
let mut count = use_state(cx, || 0);
|
let mut count = use_state(cx, || 0);
|
||||||
let text = use_state(cx, || "...".to_string());
|
let text = use_state(cx, || "...".to_string());
|
||||||
|
|||||||
@@ -22,14 +22,8 @@ fn app(cx: Scope<AppProps>) -> Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn Child(cx: Scope) -> Element {
|
fn Child(cx: Scope) -> Element {
|
||||||
let state = use_server_future(cx, (), |()| async move {
|
let state =
|
||||||
loop {
|
use_server_future(cx, (), |()| async move { get_server_data().await.unwrap() })?.value();
|
||||||
if let Ok(res) = get_server_data().await {
|
|
||||||
break res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})?
|
|
||||||
.value();
|
|
||||||
|
|
||||||
let mut count = use_state(cx, || 0);
|
let mut count = use_state(cx, || 0);
|
||||||
let text = use_state(cx, || "...".to_string());
|
let text = use_state(cx, || "...".to_string());
|
||||||
|
|||||||
Reference in new issue
Block a user