title: Set boolean back to original state using redux and react
body: <p>I have the following scenario where I am using a Preloader before my data is being fetched, then on success it sets a boolean to false, and the data is then being pulled in. All this is working fine, but when using a click event and dispatching again which all works fine, the boolean value is not returning to it's originally state, which would be 'true'. Any thoughts on what I need to do reset it back?</p>
  
  <p>App.jsx</p>
  
  <pre><code>....
  
  const mapStateToProps = (state) =&gt; ({ fetching: state.flickr.fetching, flickr: state.flickr.flickr })
  const mapDispatchToProps = (dispatch) =&gt; bindActionCreators({fetchFlickr}, dispatch)
  
  class Prices extends Component {
  
    constructor(props) {
      super(props);
    }
  
    onChange(sorter) {
      console.log('params', sorter);
    }
  
    componentDidMount() {
      socket.on('get-data-back', (data) =&gt; {
        let that = this;
        if (data) {
           this.props.fetchFlickr(); 
        }
      })
  
    }
    handleClick(e) {
  
      { this.props.fetching ? false : true } ----- Reset my value?
      socket.emit('fetchData');
    }
  
  
    render() {
      const { fetching } = this.props;
      return (
        &lt;div&gt;
          &lt;Spin spinning={fetching} delay={500} /&gt;
       &lt;button onClick={(e) =&gt; this.handleClick(e)}&gt;Refresh&lt;/button&gt;
        &lt;/div&gt;
      )    
    }
  }
  export default connect(mapStateToProps, mapDispatchToProps)(Prices); 
  </code></pre>
  
  <p>Reducer.jsx:</p>
  
  <pre><code>const initialArray = {flickr: [], fetching: true, fetched: false, error: null}
  
  function flickr(state=initialArray, action) {
      switch (action.type) {
        case "FETCH_FLICKR": {
          return {...state, fetching: true}
        }
        case "FETCH_FLICKR_REJECTED": {
          return {...state, fetching: false, error: action.payload}
        }
        case "FETCH_FLICKR_FULFILLED": {
          return {
            ...state,
            fetching: false,
            fetched: true,
            flickr: action.payload,
          }
        }
  
  
      return state
  }
  export default flickr;
  </code></pre>