Expand description
A simple, synchronous signal library for Rust. Signals are a way to react to changes in a value.
§Example
use sssignals::Signal;
let mut signal = Signal::new(0);
signal.on_change(|new, old| {
assert_eq!(new, &1);
assert_eq!(old, &0);
});
signal.set(1);
Structs§
- Signal
- A generic signal that holds a value of type
T
and allows you to react to changes in the value.
Type Aliases§
- Handler
- Type for the function executed when setting a new value.