Replies: 3 comments 1 reply
-
Don't scope at the state level. State should strive to be normalised, the smallest possible. In the end you get |
Beta Was this translation helpful? Give feedback.
-
Hi @Otbivnoe, I personally do not think it is worth the work to try to maintain the slimmer |
Beta Was this translation helpful? Give feedback.
-
I solved this problem to have two layers. One for data and one for view. Like:
And I use It's also a bit complicated to construct features like this, but I've not found a better solution. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a feature that displays a list of products using the following general model:
This screen depends on a few parameters (
name
andprice
) only, so we don't need the whole model for displaying a single product:Using the technique I need to persist the two separate arrays (the actual models and state models). The original
Product
model is required for a details screen that is presented from this list:I don't like this approach since you should keep these both properties in sync - extra space for making a mistake. On the other hand I don't like passing a whole
Product
model to list item - it makes testing harder by generating fake models.Could someone suggest a proper solution?
Beta Was this translation helpful? Give feedback.
All reactions