helper.rs 328 B

12345678910111213141516
  1. #[rustfmt::skip]
  2. use flowy_dispatch::prelude::*;
  3. use std::sync::Once;
  4. #[allow(dead_code)]
  5. pub fn setup_env() {
  6. static INIT: Once = Once::new();
  7. (|| 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. }