How to handle tree-shaped entities in Redux reducers?
问题 I'm a bit stuck thinking on how to implement a reducer where its entities can have children of the same type. Let's take reddit comments as an example: each comment can have child comments that can have comments themselves etc. For simplification reason, a comment is a record of type {id, pageId, value, children} , with pageId being the reddit page. How would one model the reducer around that? I was thinking of having the reducer be a map -> id of the comments where you can filter by page