4 ms·
> Which any framework will give you, because being out of sync with your state means that your app is broken; and it is the purpose of any framework in existenc
by davorak 4y ago
> Which any framework will give you, because being out of sync with your state means that your app is broken; and it is the purpose of any framework in existence to help you prevent your app from breaking.
That is common now yes and I think that is a good think. Uncommon techniques, now, like storing data in the DOM, uncareful jquery usage, and I am sure other techniques can deny/break a pure functional relationship.
The above is mostly historically why it is important and was not universal. How it ties into what schwartzworld said is that in react you ensure that the UI is a (pure) function of the state by default, no additional work. In signals you have to make sure to opt in every piece of state into reactivity. So I read schwartzworld's argument is that it is easier to keep(?) or at least produce the positive property of keeping the UI a pure function of the state with react than it is with signals because you do not have to do the work of opting in each piece of the state to reactivity.
- aatd86 4y agoI understand the purity constraint as the need for idempotency of the rendering function. Is that right?