title: RxJs: Map to anonymous type object
body: <p>I've created this <code>Observable</code>:</p>
  
  <pre><code>private accounts$: Observable&lt;{type: string, alias: string}&gt;;
  </code></pre>
  
  <p>I need to map an <code>Array&lt;Account&gt;</code> to an stream of <code>{type, alias}</code> object. Up to now, I've tried this:</p>
  
  <pre><code>this.accounts$ = this.store$
    .select(fromRoot.getDBoxAccountEntities)
    .flatMap(accounts =&gt; accounts.map(account =&gt; {type: 'dbox', alias: account.dboxAccount}))
    ...
  </code></pre>
  
  <p>However I'm getting compilation error messages.</p>
  
  <p>Any ideas?</p>