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