score:0

how do i retrieve what is in the store? lets say after updating my component, how can i retrieve the value inside the component and to post it?

if you want to see how is store change, you can add redux-logger to middleware to see that. when store change, it's likely a props change, you can handle this in function componentdidupdate.

how can i know what changed in my dropdown list and to retrieve it?

values in dropdown is controlled by "const products = state.productsreducer.items;", productsreducer is controlled by actions you passed in dispatch like this: "this.props.dispatch(fetchproducts());".

i think you should add redux-logger to know more how to redux work, it show on console step by step. it will help you learn faster than you think :d

score:0

to retrieve it you forgot the selecteditems

const mapstatetoprops = state => {
  const products = state.productsreducer.items;
  const loading = state.productsreducer.loading;
  const error = state.productsreducer.error;
  const selecteditems = state.prodcuts.selecteditems;
  return {
    products,
    loading,
    error,
    selecteditems
  };
};

to change it you should connect another function like

const mapdispatchtoprops = dispatch => {
    return {
        onchangedropdownselection: (selected)=> dispatch(actions.setselecteddropdown(selected))
    }
}

score:1

you will need to pass your action handlers to connect function

connect(mapstatetoprops,{actions})(productlist).

Related Query

More Query from same tag