title: How to get last emitted Observable
body: <p>I've created an Angular service that basically sets an object with some user information. When I change the user, the service emits an observable, captured by some sibling components to update the info. The problem is that the first time I set the data, there's no one subscribed yet, so I get an undefined value. I've read about converting the observable to 'hot' using publish() or share() but I'm pretty new to RxJS and I still haven't understood how it works at 100% so I'm a little lost.</p>
  <p>The service code (the relevant part):</p>
  <pre><code>getFwcUser() : Observable&lt;FwcUser&gt; {
    return this.subjectFwcUser.asObservable();
  }
  
  setFwcUser(user : FwcUser) {
    this.fwcUser = user;
  
    this.subjectFwcUser.next(this.fwcUser);
  }
  </code></pre>
  <p>NOTE: FwcUser is an interface with some user fields. I run setFwcUser inside a button handler to choose the user.</p>
  <p>The late subscriber (component code):</p>
  <pre><code>ngOnInit() {
    this.fwcUserService.getFwcUser()
      .subscribe(
        (user : FwcUser) =&gt; { console.log('Received: ', user); this.fwcUser = user; }
    );
    [......]
  }
  </code></pre>
  <p>Always prints: 'Received: undefined'.
  NOTE: The component is inside an '*ngIf=&quot;fwcUser&quot;', so it's being loaded when I call to 'setFwcUser' from a sibling component.</p>
  <p>How could I get this component to read the last value?</p>
  <p>Also, could someone recommend a good resource to learn about RxJS for beginners? I'm reading a couple of books on Angular4 but none of them explain it clearly...</p>
  <p>Thanks!</p>