convert T into signals automatically

This commit is contained in:
Evan Almloff committed 2024-01-29 13:36:39 -06:00
1 parent 1847c737e9
commit 50e3216d8b
14 files changed
+441 -103

No files matched your search

+5 -1
View File
@@ -5,7 +5,6 @@ use crate::{
use std::{
any::Any,
cell::RefCell,
mem::MaybeUninit,
ops::{Deref, DerefMut},
rc::Rc,
sync::Arc,
@@ -348,6 +347,11 @@ impl<T: 'static, S: Storage<SignalData<T>>> Signal<T, S> {
}
}
/// Take the value out of the signal, invalidating the signal in the process.
pub fn take(&self) -> T {
self.inner.take().value
}
/// Get the scope the signal was created in.
pub fn origin_scope(&self) -> ScopeId {
self.inner.origin_scope()