helper.rs 342 B

12345678910111213141516
  1. use flowy_dispatch::prelude::*;
  2. use std::sync::Once;
  3. #[allow(dead_code)]
  4. pub fn setup_env() {
  5. static INIT: Once = Once::new();
  6. std::env::);
  7. INIT.call_once(|| env_logger::init());
  8. }
  9. pub fn init_dispatch<F>(module_factory: F) -> EventDispatch
  10. where
  11. F: FnOnce() -> Vec<Module>,
  12. {
  13. EventDispatch::construct(module_factory)
  14. }