2021-09-13 15:51:13 +08:00
|
|
|
#[rustfmt::skip]
|
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-27 23:53:53 +08:00
|
|
|
pub fn setup_env() {
|
|
|
|
static INIT: Once = Once::new();
|
2021-09-16 12:35:55 +08:00
|
|
|
(|| env_logger::init());
|
2021-06-27 15:11:41 +08:00
|
|
|
}
|
|
|
|
|
2021-09-04 15:12:53 +08:00
|
|
|
pub fn init_dispatch<F>(module_factory: F) -> EventDispatch
|
2021-06-28 22:56:15 +08:00
|
|
|
where
|
2021-07-02 20:45:51 +08:00
|
|
|
F: FnOnce() -> Vec<Module>,
|
2021-06-28 22:56:15 +08:00
|
|
|
{
|
2021-09-04 15:12:53 +08:00
|
|
|
EventDispatch::construct(module_factory)
|
2021-06-28 22:56:15 +08:00
|
|
|
}
|