kjuulh c01c27a0a4
feat: update template
Signed-off-by: kjuulh <contact@kjuulh.io>
2025-01-11 22:22:39 +01:00

15 lines
413 B
Rust

use axum::extract::FromRef;
use leptos::prelude::expect_context;
use server_fn::ServerFnError;
#[derive(FromRef, Clone)]
pub struct State {}
pub async fn get_state() -> Result<State, ServerFnError> {
let state = expect_context::<crate::state::State>();
let axum::extract::State(state): axum::extract::State<crate::state::State> =
leptos_axum::extract_with_state(&state).await?;
Ok(state)
}