| 
									
										
										
										
											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)]
 | 
					
						
							|  |  |  | pub fn setup_env() {
 | 
					
						
							|  |  |  |     static INIT: Once = Once::new();
 | 
					
						
							|  |  |  |     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)
 | 
					
						
							| 
									
										
										
										
											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-07-03 14:14:10 +08:00
										 |  |  |     EventDispatch::construct(module_factory);
 | 
					
						
							| 
									
										
										
										
											2021-06-28 22:56:15 +08:00
										 |  |  | }
 |