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 would like to suggest the following code improvments:
Follow one file naming convention, I see that you are using 3, Capiltalized like AboutPage, Snake case like products_actions and Kabab case like about-usbanner.jpg.
You are directly doing http requests inside the actions. This makes the API coupled to redux. What if you some time in the future needed to fetch the products without calling a redux dispatch? It's better to separate actions from http calls.
It would be much more readable if you put the action type above the action itself, for example:
Some components are directly depending on redux. For example AllProducts gets the loading state from redux store directly. What if you wanted to replace redux with something else in the future ? you will have to visit all these components and change them. Instead, get the loading state from props and only connect the page itself (the container) and not the component (the representational one).
I would like to suggest the following code improvments:
AboutPage
, Snake case likeproducts_actions
and Kabab case likeabout-usbanner.jpg
.dispatch
? It's better to separate actions from http calls.AllProducts
gets theloading
state from redux store directly. What if you wanted to replace redux with something else in the future ? you will have to visit all these components and change them. Instead, get the loading state from props and only connect the page itself (the container) and not the component (the representational one).once for loading and once to show products. Why not using the conditional rendering ?
This is going to re-render the component in every update although it might not need to be re-rendered.
However, the code overall is actually good and you are great at styling. best of luck :D and sorry for annoying
The text was updated successfully, but these errors were encountered: