AppFlowy/rust-lib/flowy-dispatch/tests/api/helper.rs
2021-08-26 10:19:50 +08:00

18 lines
352 B
Rust

use flowy_dispatch::prelude::*;
use std::sync::Once;
#[allow(dead_code)]
= Once::new();
INIT.call_once(|| {
std::env::set_var("RUST_LOG", "flowy_dispatch=debug,debug");
env_logger::init();
});
}
pub fn init_dispatch<F>(module_factory: F)
where
F: FnOnce() -> Vec<Module>,
{
EventDispatch::construct(module_factory);
}