Redux normalizr - how can i merge all normalized object together

88 Views Asked by At

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?

0

There are 0 best solutions below