mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
add note on how to get ResponseOptions
This commit is contained in:
parent
6a83161368
commit
ef4c628994
1 changed files with 7 additions and 0 deletions
|
@ -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>>);
|
||||
|
||||
|
|
Loading…
Reference in a new issue