diff --git a/examples/counter/rust-toolchain.toml b/examples/counter/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/counter/rust-toolchain.toml +++ b/examples/counter/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/counters/rust-toolchain.toml b/examples/counters/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/counters/rust-toolchain.toml +++ b/examples/counters/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/directives/rust-toolchain.toml b/examples/directives/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/directives/rust-toolchain.toml +++ b/examples/directives/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/error_boundary/rust-toolchain.toml b/examples/error_boundary/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/error_boundary/rust-toolchain.toml +++ b/examples/error_boundary/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/errors_axum/rust-toolchain.toml b/examples/errors_axum/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/errors_axum/rust-toolchain.toml +++ b/examples/errors_axum/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/fetch/rust-toolchain.toml b/examples/fetch/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/fetch/rust-toolchain.toml +++ b/examples/fetch/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/hackernews/rust-toolchain.toml b/examples/hackernews/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/hackernews/rust-toolchain.toml +++ b/examples/hackernews/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/hackernews_axum/rust-toolchain.toml b/examples/hackernews_axum/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/hackernews_axum/rust-toolchain.toml +++ b/examples/hackernews_axum/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/hackernews_islands_axum/rust-toolchain.toml b/examples/hackernews_islands_axum/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/hackernews_islands_axum/rust-toolchain.toml +++ b/examples/hackernews_islands_axum/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/hackernews_islands_axum/src/lib.rs b/examples/hackernews_islands_axum/src/lib.rs index 50aa6366e..ea9a7d8f7 100644 --- a/examples/hackernews_islands_axum/src/lib.rs +++ b/examples/hackernews_islands_axum/src/lib.rs @@ -1,5 +1,3 @@ -#![feature(lazy_cell)] - use leptos::*; use leptos_meta::*; use leptos_router::*; diff --git a/examples/portal/rust-toolchain.toml b/examples/portal/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/portal/rust-toolchain.toml +++ b/examples/portal/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/router/rust-toolchain.toml b/examples/router/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/router/rust-toolchain.toml +++ b/examples/router/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/server_fns_axum/rust-toolchain.toml b/examples/server_fns_axum/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/server_fns_axum/rust-toolchain.toml +++ b/examples/server_fns_axum/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/session_auth_axum/rust-toolchain.toml b/examples/session_auth_axum/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/session_auth_axum/rust-toolchain.toml +++ b/examples/session_auth_axum/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/slots/rust-toolchain.toml b/examples/slots/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/slots/rust-toolchain.toml +++ b/examples/slots/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/ssr_modes/rust-toolchain.toml b/examples/ssr_modes/rust-toolchain.toml index 99fa95aaa..292fe499e 100644 --- a/examples/ssr_modes/rust-toolchain.toml +++ b/examples/ssr_modes/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/ssr_modes/src/app.rs b/examples/ssr_modes/src/app.rs index e69357a9f..437770721 100644 --- a/examples/ssr_modes/src/app.rs +++ b/examples/ssr_modes/src/app.rs @@ -80,20 +80,24 @@ fn Post() -> impl IntoView { .map_err(|_| PostError::InvalidId) }) }; - let post = create_resource(id, |id| async move { + let post_resource = create_resource(id, |id| async move { match id { Err(e) => Err(e), Ok(id) => get_post(id) .await .map(|data| data.ok_or(PostError::PostNotFound)) - .map_err(|_| PostError::ServerError) - .flatten(), + .map_err(|_| PostError::ServerError), } }); + let post = move || match post_resource.get() { + Some(Ok(Ok(v))) => Ok(v), + _ => Err(PostError::ServerError), + }; + let post_view = move || { - post.and_then(|post| { - view! { + post().and_then(|post| { + Ok(view! { // render content
{&post.content}
@@ -103,7 +107,7 @@ fn Post() -> impl IntoView { // when it's first served{&post.content}
@@ -103,7 +107,7 @@ fn Post() -> impl IntoView { // when it's first served