mirror of
https://github.com/leptos-rs/leptos.git
synced 2025-12-27 09:54:41 -05:00
fix: correct set up sandboxing for AsyncDerived futures
This commit is contained in:
@@ -484,7 +484,10 @@ impl<T: 'static> ArcAsyncDerived<T> {
|
||||
{
|
||||
let fun = move || {
|
||||
let fut = fun();
|
||||
async move { SendOption::new(Some(fut.await)) }
|
||||
let fut = async move { SendOption::new(Some(fut.await)) };
|
||||
#[cfg(feature = "sandboxed-arenas")]
|
||||
let fut = Sandboxed::new(fut);
|
||||
fut
|
||||
};
|
||||
let initial_value = SendOption::new(initial_value);
|
||||
let (this, _) = spawn_derived!(
|
||||
@@ -518,9 +521,12 @@ impl<T: 'static> ArcAsyncDerived<T> {
|
||||
{
|
||||
let fun = move || {
|
||||
let fut = fun();
|
||||
ScopedFuture::new_untracked(async move {
|
||||
let fut = ScopedFuture::new_untracked(async move {
|
||||
SendOption::new(Some(fut.await))
|
||||
})
|
||||
});
|
||||
#[cfg(feature = "sandboxed-arenas")]
|
||||
let fut = Sandboxed::new(fut);
|
||||
fut
|
||||
};
|
||||
let initial_value = SendOption::new(initial_value);
|
||||
let (this, _) = spawn_derived!(
|
||||
@@ -562,7 +568,10 @@ impl<T: 'static> ArcAsyncDerived<T> {
|
||||
{
|
||||
let fun = move || {
|
||||
let fut = fun();
|
||||
async move { SendOption::new_local(Some(fut.await)) }
|
||||
let fut = async move { SendOption::new_local(Some(fut.await)) };
|
||||
#[cfg(feature = "sandboxed-arenas")]
|
||||
let fut = Sandboxed::new(fut);
|
||||
fut
|
||||
};
|
||||
let initial_value = SendOption::new_local(initial_value);
|
||||
let (this, _) = spawn_derived!(
|
||||
@@ -598,7 +607,10 @@ impl<T: 'static> ArcAsyncDerived<T> {
|
||||
let initial = SendOption::new_local(None::<T>);
|
||||
let fun = move || {
|
||||
let fut = fun();
|
||||
async move { SendOption::new_local(Some(fut.await)) }
|
||||
let fut = async move { SendOption::new_local(Some(fut.await)) };
|
||||
#[cfg(feature = "sandboxed-arenas")]
|
||||
let fut = Sandboxed::new(fut);
|
||||
fut
|
||||
};
|
||||
let (this, _) = spawn_derived!(
|
||||
crate::spawn_local,
|
||||
|
||||
Reference in New Issue
Block a user