title: How to access previous state and current state and compare them when you subscribe to store in ngrx?
body: <p>In my component I subscribe to ngrx store which is triggered on change in the given state. I want to set the condition that if current and previous states are different then I do some action. </p>
  
  <p>How to get previous state?</p>
  
  <pre><code>    this.store
        .select('testPortfolio')
        .subscribe(testPortfolio =&gt; {
          // if(testPortfolio.oldValue !== testPortfolio.currentValueValue) ??? ///something like this
          console.log(testPortfolio);
         });
  </code></pre>