I\'m a newbie in redux and es6 syntax. I make my app with official redux tutorial, and with this example.
There is JS snippet below. My point - to define REQUEST_PO
If I understand correctly, you are having trouble getting the specific post you want.
First of all, Having your reducer also update the array and the object in it, makes it hard to read and maintain. I suggest you watch this short video explaining about reducer composition with arrays. You can simplify your code by using the technique described there.
In your case, you would a posts
reducer and a post
reducer, while posts
reducer calls the post
reducer.
As for finding the right object to work on, Dan Prince's suggestion makes it easier. Having an object map instead of an array would make it easier for you. Relevant code snippet from Dan's answer:
const initialState = {
items: {
3: {id:3, title: '1984', isFetching:false},
6: {id:6, title: 'Mouse', isFetching:false}
];
}