fix: allow setting NodeRef by implementing IsDisposed (#4367)

This commit is contained in:
Greg Johnston
2025-10-10 11:26:07 -04:00
committed by GitHub
parent c6e59eeb43
commit 616aae4c3c

View File

@@ -7,8 +7,8 @@ use reactive_graph::{
RwSignal,
},
traits::{
DefinedAt, Get, Notify, ReadUntracked, Set, Track, UntrackableGuard,
Write,
DefinedAt, Get, IsDisposed, Notify, ReadUntracked, Set, Track,
UntrackableGuard, Write,
},
};
use send_wrapper::SendWrapper;
@@ -158,6 +158,16 @@ where
}
}
impl<E> IsDisposed for NodeRef<E>
where
E: ElementType,
E::Output: 'static,
{
fn is_disposed(&self) -> bool {
self.0.is_disposed()
}
}
/// Create a [NodeRef].
#[inline(always)]
#[track_caller]