use ferro_inertia::InertiaConfig;
use std::sync::OnceLock;
static INERTIA_CONFIG: OnceLock<InertiaConfig> = OnceLock::new();
pub fn set_inertia_config(config: InertiaConfig) {
if INERTIA_CONFIG.set(config).is_err() {
eprintln!("Warning: InertiaConfig already set; second call ignored");
}
}
pub fn get_inertia_config() -> InertiaConfig {
INERTIA_CONFIG
.get()
.cloned()
.unwrap_or_else(InertiaConfig::default)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn get_inertia_config_falls_back_to_default_when_unset() {
let c = get_inertia_config();
assert_eq!(c.mount_id, "app");
}
}