title: Subscribe RxJS Observable twice. Getting value of response two times
body: <p>Suppose I have an Angular 2 Service. <code>createToken</code> function gets log in token from server:</p>
  
  <pre><code>//ANGULAR 2 SERVICE:
  //login to application
  createToken(email: string, password: string) {
      let headers = new Headers({
          'Content-Type': 'application/x-www-form-urlencoded'
      });
  
      let data = 'username=' + email + '&amp;password=' + password + '&amp;grant_type=password';
  
      this.http.post(this.loginURL, data, { headers: headers })
          .map(response =&gt; response.json())
          .subscribe(
          response =&gt; {
              localStorage.setItem(this.storageTokenKey, response.access_token);
              console.log("Token: " + response.access_token);
          },
          error =&gt; {
              console.log(error.text());
          });
  }
  </code></pre>
  
  <p>I need to do two things with my token:</p>
  
  <ol>
  <li>Save it to local storage (which will be done every time, so it should be in service)</li>
  <li>Do some operations on it in Component (display it or whatever)</li>
  </ol>
  
  <p>In order to do this (as far as I understand Observables), my <code>createToken</code> function has to return <code>Observable&lt;&gt;</code> to allow Component that will use it to call its <code>.subscribe</code> method to do some operations on result.</p>
  
  <p>Unfortunately, <a href="http://reactivex.io/rxjs/class/es6/Observable.js~Observable.html#instance-method-subscribe" rel="noreferrer">as I see from RxJS documentation</a>, <code>.subscribe</code> method doesn't return <code>Observable&lt;&gt;</code></p>
  
  <p>What should I do then to be able to call <code>.subscribe()</code> method twice?</p>