1
0
forked from ROMEO/nexosim

Changes after review

This commit is contained in:
Jaŭhien Piatlicki
2024-10-31 15:59:35 +01:00
parent 087f3c84cc
commit 0732a7ef54

View File

@ -19,7 +19,7 @@ where
/// Observable state. /// Observable state.
/// ///
/// This struct incapsulates state. Every state change is propagated to the /// This object encapsulates state. Every state change is propagated to the
/// output. /// output.
#[derive(Debug)] #[derive(Debug)]
pub struct ObservableState<S, T> pub struct ObservableState<S, T>
@ -67,6 +67,11 @@ where
self.out.send(self.state.observe()).await; self.out.send(self.state.observe()).await;
r r
} }
/// Propagate value.
pub async fn propagate(&mut self) {
self.out.send(self.state.observe()).await;
}
} }
impl<S, T> Deref for ObservableState<S, T> impl<S, T> Deref for ObservableState<S, T>