title: Subscription to promise
body: <p>In my Angular 7 application I have next function:</p>
  
  <pre><code>  getUserData(uid) {
      return this.fireStore.collection('users').doc(uid).valueChanges().subscribe(data =&gt; {
        this.writeCookie(data)
        this.currentUser = data;
      })
    }
  
  </code></pre>
  
  <p>And I want to use this function inside another method:</p>
  
  <pre><code>   someMethod() {
        ...
        new Promise(this.getUserData(uid))
           .then(() =&gt; {...})
        ...
     }
  </code></pre>
  
  <p>But I can't do this, because TypeScript throw an error:</p>
  
  <blockquote>
    <p>Argument of type 'Subscription' is not assignable to parameter of type
    '(resolve: (value?: {} | PromiseLike&lt;{}>) => void, reject: (reason?:
    any) => void) => void'.   Type 'Subscription' provides no match for
    the signature '(resolve: (value?: {} | PromiseLike&lt;{}>) => void,
    reject: (reason?: any) => void): void'.ts(2345)</p>
  </blockquote>
  
  <p>How can I transform <code>getUserData()</code> method to a promise, or use <code>forJoin</code> instead?</p>
  
  <p>Thanks in advance.</p>