fix: update imports and methods
This commit is contained in:
parent
381ff8a7b0
commit
180511e9bb
|
@ -12,8 +12,8 @@ use futures::Future;
|
|||
use hydration_context::SerializedDataId;
|
||||
use reactive_graph::{
|
||||
computed::{
|
||||
ArcAsyncDerived, ArcAsyncDerivedFuture, ArcAsyncDerivedRefFuture,
|
||||
ArcMemo, AsyncDerived, AsyncDerivedFuture, AsyncDerivedRefFuture,
|
||||
ArcAsyncDerived, ArcMemo, AsyncDerived, AsyncDerivedFuture,
|
||||
AsyncDerivedRefFuture,
|
||||
},
|
||||
graph::{Source, ToAnySubscriber},
|
||||
owner::Owner,
|
||||
|
|
|
@ -111,6 +111,7 @@ where
|
|||
}
|
||||
|
||||
impl<T: 'static> ArcAsyncDerived<T> {
|
||||
#[track_caller]
|
||||
pub fn by_ref(&self) -> AsyncDerivedRefFuture<T> {
|
||||
AsyncDerivedRefFuture {
|
||||
source: self.to_any_source(),
|
||||
|
@ -121,6 +122,14 @@ impl<T: 'static> ArcAsyncDerived<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: 'static> AsyncDerived<T> {
|
||||
#[track_caller]
|
||||
pub fn by_ref(&self) -> AsyncDerivedRefFuture<T> {
|
||||
let this = self.inner.get().unwrap_or_else(unwrap_signal!(self));
|
||||
this.by_ref()
|
||||
}
|
||||
}
|
||||
|
||||
/// A [`Future`] that is ready when an [`ArcAsyncDerived`] is finished loading or reloading,
|
||||
/// and yields an [`AsyncDerivedGuard`] that dereferences to its value.
|
||||
pub struct AsyncDerivedRefFuture<T> {
|
||||
|
|
Loading…
Reference in New Issue