问题
I am using redux with normlizr after normalizing the object I got the following store structure:
{
posts: {
byId : {
"123":{..obj},
"124":{..obj}
}
},
comments: {
byId : {
"123":{..obj},
"124":{..obj}
}
},
users:{
byId : {
"123":{..obj},
"124":{..obj}
}
}
}
the ids are the same as the posts (post is the parent lets say)
so when I select all posts I got smth like :
{
posts : [
{
"id" : "123",
...data
"comment":"123",
"user": "123"
}
]
}
but I would like the data of comment and user also inside the posts array result instead of only id
how can I achieve that?
来源:https://stackoverflow.com/questions/64853944/redux-normalizr-how-can-i-merge-all-normalized-object-together