title: How to return boolean observable and check that boolean value
body: <p>I want to use observable to be able to run my code synchronously, I want to return a true value after i get the icons from the server so that i can use it. How do i do it ?</p>
  
  <pre><code>ngOnInit() {
    this.addIcons().subscribe(data=&gt;{
      if(data===true)
        //do something use the data
  
    });
  }
  
  addIcons():Observable&lt;boolean&gt;{
  
    this.Service.getIcons().subscribe(icons =&gt; {
  
      return  return observableOf(true);   
    });
  
    return observableOf(false);   
  
  }
  </code></pre>