pub async fn extend_future<U>(&self, f: impl Future<Output = U>) -> Option<U> {
        // We only upgrade this temporarily for the duration of this
        // function call.
        if let Some(this) = self.0.upgrade() {
            SCOPES.with(|scopes| {
                scopes.borrow_mut().push(ReactiveScope(this)); // We now have 2 references to the
                                                               // scope.
            });
            let u = f.await;
            SCOPES.with(|scopes| {
                scopes.borrow_mut().pop().unwrap(); // Rationale: pop the scope we pushed above.
                                                    // Since we have 2 references to the scope, this will not drop the scope.
                Some(u)
            })
        } else {
            None
        }
    }
/// Runs the passed future in the reactive scope pointed to by this handle.
///
/// If the scope has already been destroyed, the callback is not run and `None` is returned.
Runs the passed future in the reactive scope pointed to by this handle.
If the scope has already been destroyed, the callback is not run and `None` is returned.
Runs the passed future in the reactive scope pointed to by this handle . If the scope has already been destroyed the callback is not run and ` None ` is returned .
pub async fn extend_future<U>(&self, f: impl Future<Output = U>) -> Option<U> {
        // We only upgrade this temporarily for the duration of this
        // function call.
        if let Some(this) = self.0.upgrade() {
            SCOPES.with(|scopes| {
                scopes.borrow_mut().push(ReactiveScope(this)); // We now have 2 references to the
                                                               // scope.
            });
            let u = f.await;
            SCOPES.with(|scopes| {
                scopes.borrow_mut().pop().unwrap(); // Rationale: pop the scope we pushed above.
                                                    // Since we have 2 references to the scope, this will not drop the scope.
                Some(u)
            })
        } else {
            None
        }
    }
pub async fn extend_future < U > ( & self , f : impl Future < Output = U > ) -> Option < U > { // We only upgrade this temporarily for the duration of this // function call. if let Some ( this ) = self . 0 . upgrade ( ) { SCOPES . with ( | scopes | { scopes . borrow_mut ( ) . push ( ReactiveScope ( this ) ) ; // We now have 2 references to the // scope. } ) ; let u = f . await ; SCOPES . with ( | scopes | { scopes . borrow_mut ( ) . pop ( ) . unwrap ( ) ; // Rationale: pop the scope we pushed above. // Since we have 2 references to the scope, this will not drop the scope. Some ( u ) } ) } else { None } }
Runs the passed future in the reactive scope pointed to by this handle.
Runs the passed future in the reactive scope pointed to by this handle .
&self
f
impl Future<Output = U>