I have been trying to learn how to better structure my Redux stores and stumbled upon this lesson by Dan.
https://egghead.io/lessons/javascript-redux-normalizing-the-sta
Why do we need to maintain a list of allIds? Why maintain this additional state, when we can easily map over the list of all todos and obtain it?
Storing an array of IDs allows us to define an order for the items. While JS engines now have a fairly standardized process for iterating across keys in an object, you shouldn't rely on that to define ordering.
Answer thanks to markerikson