title: How to use an ngrx selector that has a parameter that depends on another selector
body: <p>I'm trying to use an ngrx selector that takes a property of jobId to return some data as an observable.</p>
  
  <p>I'm first loading all of the jobs and tasks from a database but they don't come back in time for the selectors and I get an error because this.task is undefined, which I believe is keeping the observable from running again.  </p>
  
  <p>Is there a way to wait for the data to return before the selectors try to fetch the data from the store? </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>this.store.dispatch(fromTasks.loadAllTasks());
  this.store.dispatch(fromJobs.loadAllJobs());
  
  taskSubscription$ = this.store.pipe(
   select(fromTask.getSelectedTask),
   tap(task =&gt; this.task = task)).subscribe()
  
  jobSubscription$ = this.store.pipe(
   select(fromJob.getJobById, {jobId: this.task.jobId}),
   tap(job =&gt; this.job = job)).subscribe();</code></pre>
  </div>
  </div>
  </p>