title: Return observable before emitting event
body: <p>I created a function that if it does not have the object in memory, it fetches it before returning.</p>
  <p>However when it has it in memory it was emitting instantly before allowing the subscribers to subscribe to the event.</p>
  <p>To solve this i added  a setTimeout as in the example below, but i feel that it is <em>hacky</em>.</p>
  <p>Question is, is there a better way (best practices) to solve this ?</p>
  <pre><code>itemSubject = new Subject&lt;T[]&gt;();
  getAll(): Observable&lt;T[]&gt; {
  
      if (this.snapshot) {
          setTimeout(() =&gt; { //this is what i am trying to replace.
              this.itemSubject.next(this.snapshot)
          }, 0);
      }
      else {
          this.load().subscribe(
              (res) =&gt; {
                  this.snapshot = (&lt;any&gt;res).data
                  this.itemSubject.next(this.snapshot);
              }
          );
      }
      return this.itemSubject.asObservable();
  }
  </code></pre>