Skip to content

Instantly share code, notes, and snippets.

@msarsha
Created July 3, 2020 11:10
Show Gist options
  • Save msarsha/48d33f30830745b59cf7aa199a23d2e8 to your computer and use it in GitHub Desktop.
Save msarsha/48d33f30830745b59cf7aa199a23d2e8 to your computer and use it in GitHub Desktop.
storeList$: Observable<Map<string,number>>;
stores$: Observable<string[]>;
ngOnInit() {
this.stores$ = this.itemsQuery.selectAll().pipe(map(entities =>
entities.map(entity => entity.store)
// .filter((elem, index, self) => {
// return index === self.indexOf(elem);
// })
));
this.storeList$ = this.stores$.pipe(map((stores) => this.countItemsPerStore(stores)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment