diff --git a/packages/fullstack/examples/axum-hello-world/src/main.rs b/packages/fullstack/examples/axum-hello-world/src/main.rs index 8a460c685..a5724f8ee 100644 --- a/packages/fullstack/examples/axum-hello-world/src/main.rs +++ b/packages/fullstack/examples/axum-hello-world/src/main.rs @@ -22,14 +22,8 @@ fn app(cx: Scope) -> 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()); diff --git a/packages/fullstack/examples/salvo-hello-world/src/main.rs b/packages/fullstack/examples/salvo-hello-world/src/main.rs index d9dcea86f..09c68e1f4 100644 --- a/packages/fullstack/examples/salvo-hello-world/src/main.rs +++ b/packages/fullstack/examples/salvo-hello-world/src/main.rs @@ -22,14 +22,8 @@ fn app(cx: Scope) -> 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()); diff --git a/packages/fullstack/examples/warp-hello-world/src/main.rs b/packages/fullstack/examples/warp-hello-world/src/main.rs index d9dcea86f..09c68e1f4 100644 --- a/packages/fullstack/examples/warp-hello-world/src/main.rs +++ b/packages/fullstack/examples/warp-hello-world/src/main.rs @@ -22,14 +22,8 @@ fn app(cx: Scope) -> 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());