AppFlowy/rust-lib/flowy-sdk/src/module.rs

15 lines
420 B
Rust
Raw Normal View History

2021-07-08 13:23:44 +00:00
use flowy_dispatch::prelude::Module;
2021-07-09 15:31:44 +00:00
use flowy_user::prelude::user_session::{UserSession, UserSessionConfig};
use std::sync::Arc;
2021-06-30 15:11:27 +00:00
2021-07-09 15:31:44 +00:00
pub struct ModuleConfig {
pub root: String,
}
pub fn build_modules(config: ModuleConfig) -> Vec<Module> {
let user_config = UserSessionConfig::new(&config.root);
let user_session = Arc::new(UserSession::new(user_config));
vec![flowy_user::module::create(user_session)]
}