You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose to extend the library with a reducer that will update such ids arrays. Because it should know where to look for them, also this change involves modifying reducersFor to accept an description object. Here is a simple gist to demonstrate what I mean (without modifying redux-crud itself).
There's no such problem if handle relations like you are doing. But, how did you got post_id in the comment resource? Does your API return it with post_id (a bit strange for REST) or is it a part of normalization? After all, it looks like a relational database on top of redux store. I'm new to the modern web and wonder if it's a good idea?
Anyway, I've just wanted to know what do you think about it. I think that have such reducer out of the box is nice. If this use-case doesn't fit redux-crud and somebody will be interested, I can publish it as a separate package.
Hi. In my app I have two reducers that I always use with redux-crud:
RECORD_CHANGE
- to change some record (on client, without update to server)Posts' reducer listens for
COMMENTS_CREATE_START
,COMMENTS_CREATE_SUCCESS
,COMMENTS_DELETE_SUCCESS
and updates comments ids in posts.They are tightly related to crud operations to be in this package. What do you think? I can make a PR with tests.
Also, thx for answering my previous question (sorry, I hadn't noticed the old one issue on the same topic).
The text was updated successfully, but these errors were encountered: