A reactive programming library for Moonbit
test "signal_update" {
let values = []
let s = new(0)
s.subscribe_permanent(fn(v) { values.push(v) })
assert_eq!(s.val(), 0)
s.update(5) // This will notify subscribers with the new value.
assert_eq!(s.val(), 5)
assert_eq!(values, [0, 5])
s.update(10) // This will notify subscribers with the new value.
assert_eq!(s.val(), 10)
assert_eq!(values, [0, 5, 10])
}A reactive programming library for Moonbit