forked from ROMEO/nexosim
Changes after review
This commit is contained in:
@ -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>
|
||||||
|
Reference in New Issue
Block a user