title: CombineLatest and return values
body: <p>In the first example, I have a component that calls this ClientService.
  First we call loadClientMetrics, to populate the properties, but then take the properties and immediately send them into the calculateClientInsightsMetrics function. However I would like to change the service like in the second example to utilize the the properties in the service without having to pull them out just to pass them back in. Below is what I would like to do, however the combineLatest does not return before the return value, and undefined is returned. Can someone help me out? I'm looking to find a way to have the combineLatest finish before my return value is returned.</p>
  <p>Main issue being I have a synchronous method that makes asynchronous calls.</p>
  <pre><code>  export class ClientService {
  
    private metrics = new BehaviorSubject&lt;ClientMetrics&gt;(undefined);
    public metrics$ = this.metrics.asObservable().pipe(distinctUntilChanged(), shareReplay(1));
    private clients = new BehaviorSubject&lt;Client[]&gt;(undefined);
    public clients$ = this.clients.asObservable().pipe(distinctUntilChanged(), shareReplay(1));
    private clientsBySHID = new BehaviorSubject&lt;Client[]&gt;(undefined);
    public clientsBySHID$ = this.clientsBySHID.asObservable().pipe(distinctUntilChanged(), shareReplay(1));
    
    ...
    
    public loadClientMetrics(forceReload: boolean = false) {
      this.loadMetrics(forceReload);
      this.loadClients(forceReload);
      this.loadClientsByShareholderID(forceReload);
    }
    
    ...
    
    public calculateClientInsightsMetrics(metrics: ClientMetrics[], clients: Client[], kycClients: Client[], clientFilter: string): ClientInsightsMetric[] {
        
        let metrics = new Array&lt;ClientInsightsMetric&gt;();
        
      ...Do stuff
      
      return metrics;
        
    }
  
  }
  </code></pre>
  <pre><code>   export class ClientService {
  
    private metrics = new BehaviorSubject&lt;ClientMetrics&gt;(undefined);
    public metrics$ = this.metrics.asObservable().pipe(distinctUntilChanged(), shareReplay(1));
    private clients = new BehaviorSubject&lt;Client[]&gt;(undefined);
    public clients$ = this.clients.asObservable().pipe(distinctUntilChanged(), shareReplay(1));
    private clientsBySHID = new BehaviorSubject&lt;Client[]&gt;(undefined);
    public clientsBySHID$ = this.clientsBySHID.asObservable().pipe(distinctUntilChanged(), shareReplay(1));
    
    ...
    
    public loadClientMetrics(forceReload: boolean = false) {
      this.loadMetrics(forceReload);
      this.loadClients(forceReload);
      this.loadClientsByShareholderID(forceReload);
    }
    
    ...
    
    public calculateClientInsightsMetrics(clientFilter: string): ClientInsightsMetric[] {
        
        let metrics = new Array&lt;ClientInsightsMetric&gt;();
        this.loadClientMetrics(false);
  
        combineLatest([
        this.metrics$,
        this.clients$,
        this.clientsBySHID$
      ]).subscribe(data =&gt; {
          
        ...Do stuff with the data[0], data[1], and data[2]
        
      });
      
      return metrics;
        
    }
  
  }
  </code></pre>