title: How to ignore any subsequent values from a ReplaySubject?
body: <p>I am using an Angular library (<a href="https://github.com/abacritt/angularx-social-login" rel="nofollow noreferrer">https://github.com/abacritt/angularx-social-login</a>) which helps with Google social signin</p>
  <p>The library provides a ReplaySubject which emits values once the user has logged into Google and gives a user object containing data</p>
  <p>For whatever reason, this ReplySubject omits duplicate objects at exactly the same time and even inspecting the microsecond time gives the same result so it is making it impossible for me to write code that ignores any 1 particular emit value</p>
  <p>I have tried using .pipe(first()), .pipe(take(1)) and .pipe(last()) but this causes the ReplaySubject to not run at all</p>
  <p>What other options do I have here to help me only take 1 particular Replay value and ignore the rest. I don't mind if I only take the 1st or the last as they are always identical with data</p>
  <p>I am subscribing to the observable using:</p>
  <pre><code>this.socialAuthService.authState.subscribe(value =&gt; console.log(value));
  </code></pre>
  <p>I have tried:</p>
  <pre><code>this.socialAuthService.authState.pipe(distinct()).subscribe(val =&gt; console.log(val));
  </code></pre>
  <p>I have also tried:</p>
  <pre><code>this.socialAuthService.authState.pipe(distinctUntilChanged()).subscribe(val =&gt; console.log(val));
  </code></pre>
  <p>Also:</p>
  <pre><code>this.socialAuthService.authState.pipe(take(1)).subscribe(val =&gt; console.log(val));
  </code></pre>
  <p>Also:</p>
  <pre><code>this.socialAuthService.authState.pipe(first()).subscribe(val =&gt; console.log(val));
  </code></pre>
  <p>Also:</p>
  <pre><code>this.socialAuthService.authState.pipe(last()).subscribe(val =&gt; console.log(val));
  </code></pre>
  <p>Also:</p>
  <pre><code>this.socialAuthService.authState.pipe(distinctUntilChanged((a, b) =&gt; a === b)).subscribe(val =&gt; console.log(val));
  </code></pre>
  <p>Also:</p>
  <pre><code>this.socialAuthService.authState.pipe(distinctUntilChanged((a, b) =&gt; a.id === b.id)).subscribe(val =&gt; console.log(val));
  </code></pre>
  <p><strong>Solved</strong></p>
  <p>The component I was creating the subscription inside was being called twice. I think maybe the original authState subscription was staying active afterwards</p>