title: Format data in store with @ngrx/data and @ngrx/entity, not in component (subscriber)
body: <p>While working with <code>ngrx/data</code> I find myself parsing and formatting data from the store in multiple places: converting strings to date objects or formatting strings. I recently discovered <code>filterFn</code> which lets me fetch only the entities that are relevant for my use case from the store, but I can't seem to find anything which lets me apply formatting to all of the entities of a certain kind.</p>
  <p>Here is an example where I have to format and parse my data in my component before subscribing to it. Ideally this should not be done here, but in a more central place...any ideas of how to deal with this issue in ngrx?</p>
  <p><strong>entity.data.config.ts</strong></p>
  <pre class="lang-js prettyprint-override"><code>// I would like to parse and format data here. Is that a good idea?
  const entityMetadata: EntityMetadataMap = {
      letter: {
          // https://ngrx.io/guide/data/entity-metadata#filterfn
          filterFn: (entities, clientId) =&gt; {
              return entities.filter(entity =&gt; entity.clientId === Number(clientId));
          },
      },
  };
  </code></pre>
  <p><strong>my.component.ts</strong></p>
  <pre class="lang-js prettyprint-override"><code>@Component({
      selector: 'my-component',
      templateUrl: './my.component.html',
  })
  export class MyComponent implements OnInit {
      public letters$: Observable&lt;LetterParsed[]&gt;;
      public clientId: string;
  
      public constructor(public letterDataService: LetterDataService) {}
  
      public ngOnInit(): void {
          this.clientId = '1';
  
          // call API, GET letter voor current clientId and add to store
          this.letterDataService.getWithQuery({
              clientId: this.clientId,
          });
  
          // set filter and fetch only filtered letter entities from store
          this.letterDataService.setFilter(this.clientId);
          this.letters$ = this.letterDataService.filteredEntities$.pipe(
              // this is where I do the parsing, which ideally I want to avoid...
              map((letters: Letter[]) =&gt; letters.map(letter =&gt; this.parseLetter(letter))),
          );
      }
  
      private parseLetter(letter: Letter): LetterParsed {
          return {
              ...letter,
              status: this.formatStatus(letter.status),
              date: new Date(letter.date),
          };
      }
  
      /**
       * @param status e.g 'I_LOVE_ANGULAR'
       * @returns 'I love angular'
       */
      private formatStatus(status: string): string {
          const splitLowercase = status.split('_').join(' ').toLowerCase();
          return splitLowercase[0].toUpperCase() + splitLowercase.slice(1);
      }
  }
  </code></pre>