title: How to handle multiple api request,to show loading indicator from one variable in redux store
body: <p>i wanted to show loader for each and every request individually depending on what request made,Suppose in dashboard i have muiltple widget and they all have different api call, i wanted to show different loader for each request made,</p>
  
  <p>one way is to make adding <strong>isLoading</strong> flag for every request made,which i think is not the good solution as the application grows,and i am finding solution that can handle multiple request from one flag </p>
  
  <p>so how should i do to make dynamic individual loader based on every request</p>
  
  <p>below is my reducer and action</p>
  
  <blockquote>
    <p>reducer</p>
  </blockquote>
  
  <pre><code>export const intialstate = {
  isAuth: false,
  isLoading: false,
  btnDisable: false
  };
  
  export default function(state = intialstate, action) {
  switch (action.type) {
      case API_REQUEST:
          return {
              ...state,
              isLoading: true,
          };
      case API_SUCCESS:
          return {
              ...state,
              isLoading: false,
              isError: null
          };
      case API_FAILURE:
          return {
              ...state,
              isError: action.payload,
              isLoading: false,
          };
      // no default
   }
   return state;
  }
  </code></pre>
  
  <blockquote>
    <p>action.js</p>
  </blockquote>
  
  <pre><code>export const AnyAPIRequest = () =&gt; {
  return (dispatch) =&gt; {
      dispatch({
          type: API_REQUEST
      });
  
      API.anygetcall()
          .then((res) =&gt; {
              dispatch({
                  type: API_SUCCESS
              });
  
              dispatch({ type: GETLIST, payload: res });
          })
          .catch((err) =&gt; {
              dispatch({
                  type: API_FAILURE,
                  payload: err
              });
          });
  };
  };
  </code></pre>
  
  <p>Please help,how to implement dynamic loader based on different request and let me know any thing to update in current workflow</p>