title: convert to rxjs methodology
body: <p>I want to convert the following 2 methods to rxjs methodology. How can i do that. The second method depends upon the results of the first.</p>
  
  <pre><code>export class EntityStorage {
    private entitiesStore: Map&lt;string, any[]&gt; = new Map&lt;string, any[]&gt;();
  
    constructor(private apiService: ApiService) {}
  
    loadAllEntity(key: string, httpParams: HttpParams): void {
      this.apiService.getEntities(key, httpParams).subscribe(
        (entities) =&gt; {
          this.entitiesStore.set(key, entities);
        },
        (error) =&gt; {
          console.error(error);
        },
        () =&gt; {}
      );
    }
  
    getStoreWithKey(key: string): any[] {
      return this.entitiesStore.get(key);
    }
  }
  </code></pre>