Closed Kerimcanak closed 3 months ago
[x] Install and initialize Redux with Redux Thunk, Logger middleware
redux
react-redux
redux-thunk
logger
store
[x] Create Reducers with only basic set actions, reducers should have exact same structure below:
[x] Client Reducer:
{Object}
{Object Array}
{String}
[x] Client Reducer Actions:
[x] Product Reducer:
{Number}
{Number} | 25 by default
{Number} | 0 by default
{String} | "NOT_FETCHED" by default | one of "NOT_FETCHED" , "FETCHING", "FETCHED", "FAILED"
[x] Product Reducer Actions:
[x] ShoppingCart reducer
cart: {Object Array} will keep products are being bought
[ { count: 1, product: { id: “1235”, … } }, { count: 3, product: { id: “1236”, … } }, ]
payment {Object} will keep payment information
address {Object} will keep address information
[x] ShoppingCart Reducer Actions
[x] Code action creators for those reducers and each field above
action creators
[x] Create thunk action creator to get roles and put it in store. NOTE: It should be triggered only in case of need!
thunk action creator
roles
researching about this subject, Redux is hard subject for me.
Let this be my guide: https://redux.js.org/tutorials/fundamentals/part-3-state-actions-reducers#creating-the-root-reducer
https://www.geeksforgeeks.org/handling-asynchronous-actions-with-redux-thunk/ reading this as of now ૮ `⎚⩊⎚´ ა
[x] Install and initialize Redux with Redux Thunk, Logger middleware
redux
,react-redux
andredux-thunk
,logger
middleware librariesstore
object[x] Create Reducers with only basic set actions, reducers should have exact same structure below:
[x] Client Reducer:
{Object}
all about user{Object Array}
address list of the user{Object Array}
credit card list of the user{Object Array}
{String}
{String}
[x] Client Reducer Actions:
[x] Product Reducer:
{Object Array}
{Object Array}
{Number}
number of total products{Number} | 25 by default
product count on the page{Number} | 0 by default
for pagination{String}
{String} | "NOT_FETCHED" by default | one of "NOT_FETCHED" , "FETCHING", "FETCHED", "FAILED"
[x] Product Reducer Actions:
[x] ShoppingCart reducer
cart:
{Object Array}
will keep products are being boughtpayment
{Object}
will keep payment informationaddress
{Object}
will keep address information[x] ShoppingCart Reducer Actions
[x] Code
action creators
for those reducers and each field above[x] Create
thunk action creator
to getroles
and put it in store. NOTE: It should be triggered only in case of need!