3 ms·
In contrast, it doesn't happen with a denormalized, UI-agnostic state: Isn't it the other way around? the UI-agnostic state IS the normalized version; the UI-a
by bernawil 7y ago
In contrast, it doesn't happen with a denormalized, UI-agnostic state:
Isn't it the other way around? the UI-agnostic state IS the normalized version; the UI-aware state ready to be consumed is the denormalized one.
The choice is pretty simple to me: keep the State normalized, de-normalize it in selectors for consumption in the UI. Those selectors will look pretty much the same as the reducers you'd be writing anyway.
- naasking 7y agoCame just to post this. The state he's described is definitely normalized, and the UI-specific one is denormalized. And I think your advice is exactly right: project your normalized state into a view that's useful for consumption by other components. Basically, the same pattern we've been applying to relational databases for decades.