add frontend folder

This commit is contained in:
appflowy
2021-11-20 09:32:46 +08:00
parent f93f012bc8
commit 8f1d62f115
1697 changed files with 754 additions and 104 deletions

View File

@ -0,0 +1 @@
mod module;

View File

@ -0,0 +1,21 @@
use lib_dispatch::prelude::*;
use std::sync::Arc;
pub async fn hello() -> String { "say hello".to_string() }
#[tokio::test]
async fn test() {
env_logger::init();
let event = "1";
let dispatch = Arc::new(EventDispatch::construct(|| vec![Module::new().event(event, hello)]));
let request = ModuleRequest::new(event);
let _ = EventDispatch::async_send_with_callback(dispatch.clone(), request, |resp| {
Box::pin(async move {
dbg!(&resp);
})
})
.await;
std::mem::forget(dispatch);
}