Since ngrx.io has opened, some issues have been closed regarding the community interest in more detailed recipes or stories, such as this one : #692.
The ngrx.io site is really nice and goes quite deep on explaining the mechanics of @ngrx.
But it does not answer or give any resource, regarding some quite frequent general questions, such as : what would be the recommended approach on how to handle deep/relational data in regards to normalization with ngrx/entity.
Some links to existing stuff could be a start : Redux Normalizing State Shape
Some examples with ngrx entity would be greatly appreciated and I found a bunch of other guys asking around the same question : Twitter with Mike Ryan
Hi @Stephane-Peyroutet, this is on our list of things to add to the docs for entity. The Redux doc you mentioned is a good reference point though
Hi @brandonroberts ,
Thanks for the quick reply and it's good to know this will be added to the docs.
I'm also really interested and excited with the upcoming integration of ngrx-data within the @ngrx/platform.
I'm closing this one to keep the issues clean as this is or will be taken care of.
Would you perhaps supply a short example of how this is done before the recipe exists in the documentation? This issue now exists since april and a small explanation on how to solve this problem would help me a lot. At the moment I have an "Add-Action" for every entity whicht I call in a Effect.
Example of how I solve this so far:
Or should I just have one Action (AddPosts), which contains also the comments in the payload and the CommentReducer handles the AddPosts-Action?
Another problem I have: After normalizing the Posts, I can't use the same model interface to annotate the posts because now the comments array is not of type Comment[], but number[] or string[]. But I also don't want to create extra models just for the normalized shape. How should I annotate the comments array so that I can use it for the "not-normalized" form as well as for the normalized form?
@brandonroberts do we have an update on this? Thank you.
Still nothing?
Any updates on this?
I hope a solution will be found. this is a very important thing
Any update on this? In Redux they recommend using Normalizr for nested data. What's the recommended approach in NgRx @brandonroberts?
Normalize can be used without problems. But I think we need a solution like Redux ORM
Normilze should work without problem since it has been widely used in react.
My confusion is with twitter of mike ryan.
API -> normalizr -> ngrx/entity -> store.
I could just do API -> normalizr -> store but i lost benefits of using ngrx entity library.
Hope there is a good example to show best practise.
Most helpful comment
Would you perhaps supply a short example of how this is done before the recipe exists in the documentation? This issue now exists since april and a small explanation on how to solve this problem would help me a lot. At the moment I have an "Add-Action" for every entity whicht I call in a Effect.
Example of how I solve this so far:
Or should I just have one Action (AddPosts), which contains also the comments in the payload and the CommentReducer handles the AddPosts-Action?
Another problem I have: After normalizing the Posts, I can't use the same model interface to annotate the posts because now the comments array is not of type Comment[], but number[] or string[]. But I also don't want to create extra models just for the normalized shape. How should I annotate the comments array so that I can use it for the "not-normalized" form as well as for the normalized form?