mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-11-04 03:54:44 +00:00 
			
		
		
		
	* refactor: user manager * refactor: user manager * refactor: session location * refactor: user manager * chore: gen ts files * feat: implement indexeddb persistence * chore: integrate user manager * chore: update * chore: run on web thread * chore: run on web thread * chore: fix test * chore: add test * chore: add test * chore: add user & sign in with password * chore: fix test * chore: update docs * chore: fix warnings * chore: gen files * chore: add user * chore: add files * chore: update config * chore: update scirpt * chore: update scirpt * fix: build * chore: update command * fix: ci * ci: fix * fix: compile * fix: compile * fix: ci * fix: compile * fix: tauri build * chore: fix test * chore: fix test
		
			
				
	
	
		
			28 lines
		
	
	
		
			623 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			623 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
use std::sync::Arc;
 | 
						|
 | 
						|
use lib_dispatch::prelude::*;
 | 
						|
use lib_dispatch::runtime::AFPluginRuntime;
 | 
						|
 | 
						|
pub async fn hello() -> String {
 | 
						|
  "say hello".to_string()
 | 
						|
}
 | 
						|
 | 
						|
#[tokio::test]
 | 
						|
async fn test() {
 | 
						|
  let event = "1";
 | 
						|
  let runtime = Arc::new(AFPluginRuntime::new().unwrap());
 | 
						|
  let dispatch = Arc::new(AFPluginDispatcher::new(
 | 
						|
    runtime,
 | 
						|
    vec![AFPlugin::new().event(event, hello)],
 | 
						|
  ));
 | 
						|
  let request = AFPluginRequest::new(event);
 | 
						|
  let _ = AFPluginDispatcher::async_send_with_callback(dispatch.as_ref(), request, |resp| {
 | 
						|
    Box::pin(async move {
 | 
						|
      dbg!(&resp);
 | 
						|
    })
 | 
						|
  })
 | 
						|
  .await;
 | 
						|
 | 
						|
  std::mem::forget(dispatch);
 | 
						|
}
 |