AppFlowy/rust-lib/flowy-dispatch/tests/api/helper.rs

17 lines
342 B
Rust
Raw Normal View History

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-27 15:53:53 +00:00
pub fn setup_env() {
static INIT: Once = Once::new();
std::env::);
INIT.call_once(|| env_logger::init());
2021-06-27 07:11:41 +00:00
}
2021-09-04 07:12:53 +00:00
pub fn init_dispatch<F>(module_factory: F) -> EventDispatch
where
F: FnOnce() -> Vec<Module>,
{
2021-09-04 07:12:53 +00:00
EventDispatch::construct(module_factory)
}