Redux leaves you free to decide how to split to split your reducers; they are just transformations…
Milo Mordaunt
1

Hrmn… I’m getting it one by one now. Really appreciate all the help Milo. But can I ask you one more… I’m still a bit confused about how to build my reducer(s)… Tell me if this is a bit complex to ask here.

So far I have this, I have three pages w/c is the IndexPage w/c would list the top products for the day, the SearchPage w/c received an “s” parameter to search for the product’s name , and the ProductPage w/c displays the details of the page when clicked.

All this pages I get my data from an old rails app w/c we are converting into React and now I’m starting to serve JSON’s for the data it used to display (old html.erb).

So far I have a reducer like:

{

indexPage: {page: 0, lastPage: false, data: []}

searchPage: {page: 0, lastPage: false, data:[]} // Thinking of having this next for my search page

currentProduct: {data: {}} // This for the product page

}

The search and current are I’m still working on but and I’m still contemplating if I’m implementing them right. Did I get this right? Am I using react+redux the right way?

Like what you read? Give Alec a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.