computedPrevious
computedPrevious
is a helper function that returns a signal
that emits the previous value of the passed signal
. It’s useful when you want to keep track of the previous value of a signal.
As the initial value it will emit the current value of the signal, and then it will emit the previous value every time the signal changes.
Usage
computedPrevious
accepts a Signal
and returns a Signal
that emits the previous value of the passed Signal
.