From ef4c628994b8b18c9b6b762175c558ddf9465b20 Mon Sep 17 00:00:00 2001 From: Sam Judelson <64875465+sjud@users.noreply.github.com> Date: Wed, 28 Feb 2024 14:21:30 -0500 Subject: [PATCH] add note on how to get ResponseOptions --- integrations/axum/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/integrations/axum/src/lib.rs b/integrations/axum/src/lib.rs index 42d69fdd0..3a888d540 100644 --- a/integrations/axum/src/lib.rs +++ b/integrations/axum/src/lib.rs @@ -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::(); +/// Ok(()) +/// } #[derive(Debug, Clone, Default)] pub struct ResponseOptions(pub Arc>);