use flowy_sys::prelude::*; use std::{cell::RefCell, sync::Once}; #[allow(dead_code)] pub fn setup_env() { static INIT: Once = Once::new(); INIT.call_once(|| { std::env::set_var("RUST_LOG", "flowy_sys=debug,debug"); env_logger::init(); }); } pub async fn async_send(data: DispatchRequest) -> Result { EventDispatch::async_send(data).await } pub fn init_system(module_factory: F) where F: FnOnce() -> Vec, { let system = EventDispatch::new(module_factory); EventDispatch::set_current(system); }