title: How to subscribe to empty Observable
body: <p>I've got a function which returns Observable if one condition is met:</p>
  
  <pre><code>private function() {
      for (let element of this.array) {
          if (element.id == this.element2.id) {
              return Observable.fromPromise(this.databaseProvider.selectFor(element.id));
          }
      }
      // return Observable.of();
  }
  </code></pre>
  
  <p>and subscribing to it:</p>
  
  <pre><code>this.function().subscribe(id =&gt; {
      if (id) {
          // do something with value
      } else {
          // do something without value
      }
  }
  </code></pre>
  
  <p>I tried returning <code>Observable.of()</code> outside the for loop but condition inside <code>.subscribe()</code> doesn't work as I wanted.</p>