mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: folder web (#4580)
* chore: folder wasm * chore: folder wasm * chore: resolve deps * chore: fix trait * chore: try localset * chore: fix * chore: fix * chore: fix * chore: async init sdk * chore: fix test * chore: fix test
This commit is contained in:
@ -13,6 +13,21 @@ macro_rules! if_wasm {
|
||||
$item
|
||||
)*}
|
||||
}
|
||||
// Define a generic macro to conditionally apply Send and Sync traits with documentation
|
||||
#[macro_export]
|
||||
macro_rules! conditional_send_sync_trait {
|
||||
($doc:expr; $trait_name:ident { $( $item:tt )* }) => {
|
||||
// For wasm32 targets, define the trait without Send + Sync
|
||||
#[doc = $doc]
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
pub trait $trait_name { $( $item )* }
|
||||
|
||||
// For non-wasm32 targets, define the trait with Send + Sync
|
||||
#[doc = $doc]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub trait $trait_name: Send + Sync { $( $item )* }
|
||||
};
|
||||
}
|
||||
|
||||
pub fn move_vec_element<T, F>(
|
||||
vec: &mut Vec<T>,
|
||||
|
Reference in New Issue
Block a user