18 lines
352 B
Rust
Raw Normal View History

2021-07-08 21:23:44 +08:00
use flowy_dispatch::prelude::*;
2021-07-05 21:23:13 +08:00
use std::sync::Once;
2021-06-27 15:11:41 +08:00
#[allow(dead_code)]
2021-08-26 10:19:50 +08:00
= Once::new();
2021-06-27 15:11:41 +08:00
INIT.call_once(|| {
2021-07-08 21:23:44 +08:00
std::env::set_var("RUST_LOG", "flowy_dispatch=debug,debug");
2021-06-27 15:11:41 +08:00
env_logger::init();
});
}
2021-07-03 14:14:10 +08:00
pub fn init_dispatch<F>(module_factory: F)
where
F: FnOnce() -> Vec<Module>,
{
2021-07-03 14:14:10 +08:00
EventDispatch::construct(module_factory);
}