//! State management for the application. use kcl_lib::settings::types::file::ProjectState; use tokio::sync::Mutex; #[derive(Debug, Default)] pub struct Store(Mutex>); impl Store { pub fn new(p: ProjectState) -> Self { Self(Mutex::new(Some(p))) } pub async fn get(&self) -> Option { self.0.lock().await.clone() } pub async fn set(&self, p: Option) { *self.0.lock().await = p; } }