componentDidMount() {
    axios.get("http://www.mocky.io/v2/5ed68221340000480106dae9").then((res) => {
      console.log(res);

      this.setState({
        posts: res.data,
      });
    });
    this.props.dispatch({
      type: 'cakes/actionSample',
      payload: {
        favouriteItems: this.state.favouriteItems
      }
    })
  }
// this is using axios, without axios we can use redux format by passing the state of store
this is using axios, without axios we can use redux format by passing the state of store
this is using axios without axios we can use redux format by passing the state of store
componentDidMount() {
    axios.get("http://www.mocky.io/v2/5ed68221340000480106dae9").then((res) => {
      console.log(res);
      this.setState({
        posts: res.data,
      });
    });
    this.props.dispatch({
      type: 'cakes/actionSample',
      payload: {
        favouriteItems: this.state.favouriteItems
      }
    })
  }
componentDidMount ( ) { axios . get ( "http://www.mocky.io/v2/5ed68221340000480106dae9" ) . then ( ( res ) => { console . log ( res ) ; this . setState ( { posts : res . data , } ) ; } ) ; this . props . dispatch ( { type : 'cakes/actionSample' , payload : { favouriteItems : this . state . favouriteItems } } ) }
this is using axios, without axios we can use redux format by passing the state of store
this is using axios without axios we can use redux format by passing the state of store