title: Extracting data from subscribe() method
body: <p>I don't really know how to extract the values from the subscribe() method.</p>
  <pre><code>getMessages(): any {
    this.gatewayMessagesState$.subscribe(data =&gt; data.gatewayMessages
      .get(this.gatewayId)
      ?.list
      .map(Message =&gt; Message.message));
    }
  </code></pre>
  <p>gatewayMessagesState is an initial state that contains some data. gatewayMessages is a map with gatewayIds as keys and arrays of Message objects as values. Message has message field that's just a string. I would like to extract an array of messages for a given id. How can I do that?</p>