I was trying to understand one of the tests and it seems it's desired that it doesn't re-compute if value of a signal is changed within a computed, but that also prevents other computed to re-run:
In this example, the computed value of b remains 2 even though the signal's value has changed within the c computed.
Is there a use-case for allowing setting signals' values within computed? If so, why not just allow to re-run itself? If it's re-run, then this particular example would result in a cycle error (which makes sense?) but if it was something like:
Hey 👋
I was trying to understand one of the tests and it seems it's desired that it doesn't re-compute if value of a signal is changed within a computed, but that also prevents other computed to re-run:
In this example, the computed value of
b
remains 2 even though the signal's value has changed within thec
computed.Is there a use-case for allowing setting signals' values within
computed
? If so, why not just allow to re-run itself? If it's re-run, then this particular example would result in a cycle error (which makes sense?) but if it was something like:It'd re-run twice but the second time because
this._value === value
then it won't trigger a third re-run.Package
"@preact/signals-core": "1.2.0"