Compare commits

...

1 Commits

Author SHA1 Message Date
Sam Judelson
ef4c628994 add note on how to get ResponseOptions 2024-02-28 14:21:30 -05:00

View File

@@ -79,6 +79,13 @@ impl ResponseParts {
}
/// Allows you to override details of the HTTP response like the status code and add Headers/Cookies.
/// ResponseOptions is stored in your server's context if you've called `.leptos_routes` on your router.
/// ```rust
/// #[server]
/// pub async fn get_opts() -> Result<(),ServerFnError> {
/// let opts = expect_context::<leptos_axum::ResponseOptions>();
/// Ok(())
/// }
#[derive(Debug, Clone, Default)]
pub struct ResponseOptions(pub Arc<RwLock<ResponseParts>>);