title: Prevent redundant API calls from NGRX effect
body: <p>I'm learning how to integrate the Redux architecture into an Angular app using the NGRX library and ran into an interesting issue that I was wondering about. I was wondering how I can prevent multiple and redundant API calls to the server when multiple components fire off the LoadApps action simultaneously.</p>
  
  <p>I have the following reducer and effect:</p>
  
  <pre><code>export function appsReducer(state = initialState, action: AppsActions): AppsState {
      switch (action.type) {
          case AppsActionTypes.LoadApps:
              return {
                  ...state,
                  pending: true,
                  data: []
              };
  
          case AppsActionTypes.LoadAppsSuccess:
              return {
                  ...state,
                  pending: false,
                  data: action.payload
              };
  
          default:
              return state;
      }
  }
  </code></pre>
  
  <pre><code>@Effect()
      loadApps = this.actions.pipe(
          ofType(AppsActionTypes.LoadApps),
          concatMap(() =&gt; this.appService.getApps().pipe(
              switchMap((res: App[]) =&gt; {
                  return [new LoadAppsSuccess(res)];
              })
          ))
      );
  </code></pre>
  
  <p>that loads a list of app objects from my API. If I have two sibling components in my angular app, for example a side-bar navigation, and a top-bar navigation component that each need the list of apps, they will both fire off the LoadApps action in their OnInit methods, resulting in two of the exact same API call to the server.</p>
  
  <p>Should the effect get the pending boolean from state to make sure it isn't true before firing off another api request, it seems to me the second call to the effect could have already started running before pending gets set to true.</p>
  
  <p>Does NGRX provide some sort of mechanism for this?</p>