diff --git a/src/machine.rs b/src/machine.rs index 792a874..d7fb90e 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -120,8 +120,16 @@ impl Machine { } } - pub fn signal(&self) -> MutableSignal { - self.state.signal() + /// Generate a signal from the internal state. + /// + /// A signal is a lossy stream of state changes. Lossy in that if changes happen in quick + /// succession intermediary values may be lost. But this isn't really relevant in this case + /// since the only relevant state is the latest one. + /// dedupe ensures that if state is changed but only changes to the value it had beforehand + /// (could for example happen if the machine changes current user but stays activated) no + /// update is sent. + pub fn signal(&self) -> impl Signal { + self.state.signal().dedupe() } }