title: How to do http polling in ngrx effect
body: <p>I have this effect, and I'm trying to use timer to poll for data every x seconds. But I can't figure out how timer is supposed to interact with the data streams. I tried adding another switchMap to the top, but then I couldn't pass the action and payload to the second switchmap. Any ideas?</p>
  
  <p>I looked at <a href="https://stackoverflow.com/questions/43154461/ngrx-store-effects-http-ajax-polling-setup-on-angular-2">this post</a> but my situation is a little different. I'm passing a payload with my action that I need to access, and I'm using ngrx 6.</p>
  
  <pre><code>@Effect()
  getData = this.actions$
      .ofType(appActions.GET_PLOT_DATA)
      .pipe(
          switchMap((action$: appActions.GetPlotDataAction) =&gt; {
              return this.http.post(
                  `http://${this.url}/data`,
                  action$.payload.getJson(),
                  {responseType: 'json', observe: 'body', headers: this.headers});
          }),
          map((plotData) =&gt; {
              return {
                  type: appActions.LOAD_DATA_SUCCESS,
                  payload: plotData
              }
          }),
          catchError((error) =&gt; throwError(error))
      )
  </code></pre>