4 ms·
Signals are also just pub/sub, but with a more ergonomic api. More ergonomic because listeners are added and released automatically. It can also be more perfor
by kabes 3y ago
Signals are also just pub/sub, but with a more ergonomic api. More ergonomic because listeners are added and released automatically.
It can also be more performant, eg, say you have a computation that depends on 2 values:
`result = a ? b : 0`
Then if a is falsy, we don't need to recompute if b changes. This is achieved automatically with signals, but would require quite some code with classic pub/sub.