Bring back mroe hooks, remove old hooks, cleanup a number of examples
This commit is contained in:
33 files changed
+179
-643
No files matched your search
@@ -158,7 +158,7 @@ impl<T: 'static> CopyValue<T> {
|
||||
}
|
||||
|
||||
/// Set the value. If the value has been dropped, this will panic.
|
||||
pub fn set(&mut self, value: T) {
|
||||
pub fn set(&self, value: T) {
|
||||
*self.write() = value;
|
||||
}
|
||||
|
||||
|
||||
@@ -292,6 +292,14 @@ impl<T: 'static> Signal<T> {
|
||||
*self.write() = value;
|
||||
}
|
||||
|
||||
/// Set the value of the signal without triggering an update on subscribers.
|
||||
///
|
||||
/// todo: we should make it so setting while rendering doesn't trigger an update s
|
||||
pub fn set_untracked(&self, value: T) {
|
||||
let mut inner = self.inner.write();
|
||||
inner.value = value;
|
||||
}
|
||||
|
||||
/// Run a closure with a reference to the signal's value.
|
||||
/// If the signal has been dropped, this will panic.
|
||||
#[track_caller]
|
||||
|
||||
Reference in new issue
Block a user