title: Run subscription only once
body: <p>I need to run <code>userProfiles$.subscribe(async res =&gt; {</code> only once. But it works infinitely. Can you tell me how to avoid it?</p>
  
  <p>This is the <a href="https://youtu.be/nllTmLZ6yjw" rel="nofollow noreferrer"><strong>video of that issue</strong></a>:</p>
  
  <p><em>.ts</em></p>
  
  <pre><code>async loginWithGoogle(): Promise&lt;void&gt; {
      try {
        const result = await this.afAuth.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider());
        const userId: string = result.additionalUserInfo.profile.id;
        const userProfile: AngularFirestoreDocument&lt;UserProfile&gt; = this.fireStore.doc(`userProfile/${userId}`);
        const userProfiles: AngularFirestoreCollection&lt;UserProfile&gt; = this.fireStore.collection('userProfile/', ref =&gt; ref.where('email', '==', result.additionalUserInfo.profile.email));
        const userProfiles$: Observable&lt;UserProfile[]&gt; = userProfiles.valueChanges();
  
        userProfiles$.subscribe(async res =&gt; { //problem is here
          if (res.length == 0) {
            await userProfile.set({
              id: userId,
              email: result.additionalUserInfo.profile.email,
              creationTime: moment().format(),
              lastSignInTime: moment().format()
            });
          } else {
            await userProfile.update({
              lastSignInTime: moment().format()
            });
          }
        });
      }
      catch (err) {
        console.log(err);
      }
    }
  </code></pre>
  
  <p>I have tried to convert it to <code>promise</code> like below. But no difference. Maybe I did it wrong? </p>
  
  <pre><code> userProfiles$.map(async res =&gt; {
          if (res.length == 0) {
            await userProfile.set({
              id: userId, email: result.additionalUserInfo.profile.email,
              creationTime: moment().format(),
              lastSignInTime: moment().format()
            });
          }
        }).toPromise();
  </code></pre>
  
  <p><strong><em>Versions:</em></strong></p>
  
  <pre><code> "typescript": "2.4.2"
   "rxjs": "5.5.2",
  </code></pre>