map((reports : IReport[]) => reports.filter(p => p.reportName === name))
findItemsByParentId(id: number): Promise<Item[]> { return new Promise<Item[]>((resolve, reject) => { this.localStorage.getItem('items') .pipe(map((items: Item[]) => items.filter((item: Item) => item.parentId === id))) .subscribe((value: Item[]) => { resolve(value); }); }); }
References
https://www.learnrxjs.io/operators/transformation/map.html
https://rxjs.dev/api/operators/map
https://stackoverflow.com/questions/52263374/angular-rxjs-observable-filter-on-array-of-objects