helper.rs 352 B

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