2 ms·
I agree with the premise. Often times, the shape of the data populating my Redux store is identical to what the backend team provides. This article makes the c
by JMTQp8lwXL 7y ago
I agree with the premise. Often times, the shape of the data populating my Redux store is identical to what the backend team provides.
This article makes the case for keeping data in third normal form in Redux [0]. If you're already following 3NF in your databases, it should be straightforward to likewise follow with your APIs. You won't need to massage the data, and if you use tools like Redux DevTools, it will be easy to reason about what what data has been loaded client-side, since the same shape is used everywhere.
Following good engineering practices upstream can be beneficial downstream. As the author shows, some data shapes make UI re-designs more difficult.
[0]: https://en.wikipedia.org/wiki/Third_normal_form https://en.wikipedia.org/wiki/Third_normal_form