#[cfg(not(target_family = "wasm"))]
pub(crate) fn spawn<F>(future: F) -> tokio::task::JoinHandle<F::Output>
where
F: futures::Future + Send + 'static,
F::Output: Send + 'static,
{
tokio::task::spawn(future)
}
#[cfg(target_family = "wasm")]
pub(crate) async fn spawn<F>(future: F) -> Result<F::Output, crate::wallet::WalletError>
where
F: futures::Future + 'static,
F::Output: 'static,
{
Ok(future.await)
}