title: How do I emit the value of an observable to an rxjs Subject?
body: <p>I'd like to provide an rxjs <code>Subject</code> from an Angular service to be able to emit values (via <code>next</code>) by calling methods on the service. One of the values I want it to emit is the result of an Angular <code>HttpClient</code> <code>get</code> call. I just can't seem to get it right. I am wondering why the following results in the subscribe handler not being called:</p>
  
  <p>-View</p>
  
  <pre><code>export default abstract class TileView implements OnInit {
    constructor (private configService : ConfigService) {}
    ngOnInit () {
      this.configService.fetch(this.type()).subscribe( res =&gt; {
        console.log(res)
      }); 
    }
  }
  </code></pre>
  
  <p>-Service</p>
  
  <pre><code>export class ConfigService {
    public subject = new AsyncSubject();
  
    constructor (private http : HttpClient) {}
  
    fetch (type) {
      this.http.get(
        api.host + api.base + interpolate(api.config, { type }) + "/"
      ).subscribe( res =&gt; {
        this.subject.next(res);
      });
  
      return this.subject;
    }
  }
  </code></pre>
  
  <p>Is there any way to return the subject and also fire off the http call with a single method call? It's strange because the subject is returned, a subscriber is registered, the http call completes and <code>this.subject.next(res)</code> is called but the subscribe handler doesn't even run.</p>