forked from ROMEO/nexosim
Changes after review
This commit is contained in:
@ -19,7 +19,7 @@ where
|
||||
|
||||
/// 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.
|
||||
#[derive(Debug)]
|
||||
pub struct ObservableState<S, T>
|
||||
@ -67,6 +67,11 @@ where
|
||||
self.out.send(self.state.observe()).await;
|
||||
r
|
||||
}
|
||||
|
||||
/// Propagate value.
|
||||
pub async fn propagate(&mut self) {
|
||||
self.out.send(self.state.observe()).await;
|
||||
}
|
||||
}
|
||||
|
||||
impl<S, T> Deref for ObservableState<S, T>
|
||||
|
Reference in New Issue
Block a user