SolidJS 2.0 one mental model for getters (Accessor vs Proxy) #1832
Replies: 1 comment
-
Feel free to contribute a community primitive that provides this API. Since stores are inside their own sub-package, they are only included if used. However, your concept could not be reactive for structural changes, e.g. exchanging two items in an array, since the branches are not supposed to be reactive. This would not be an issue for fixed-structure state, e.g. a server response, so this still might be a worthy addition, maybe even more in combination with valibot to define the structure. We already have the static-store primitive that explored the possibility of having a one level deep object state, so another state primitive would fit into our scope. |
Beta Was this translation helpful? Give feedback.
-
Problem
Proposal
Eliminate the two-concept getters by either making signals proxied objects or making store props accessor functions.
Given that stores are an addition to Solids reactive system, changing the store API seems to make more sense:
Seems like the setters for store can be simplified with an API change too:
Pros
Cons
Beta Was this translation helpful? Give feedback.
All reactions