refactor: fix input signal not allowing new values
If InputSignal is computed once, it will never re-compute unless the actual user
computation changes. This may not be the case when:
-
the input signal is only ever changing using
bindToValue. e.g. when Zone components bind to the signal input. -
the input signal is initialized with an initial value, and read before the computation is set. This should never happen in practice because we are guarding by
initialized()but it highlights the issue thatswitchedComputationneeds a way to be notified of change.
Even if we set stale=true, it doesn't guarantee that switchedComputation is re-evaluated because
the reactive graph will actually poll all consumed producers and realize that nothing changes because
e.g. we always deal with static values.
We fix this for now (needs more optimization/performance insights) by adding an producer that we can use to notify the computation.