Does anybody know why this filter after mapping, is not working?
When I do this:
this.cacheService.getMainCache().pipe( map(val => val.list)).subscribe((val) => {
console.log(val);
}, (error) => {
console.log('Error: ', error);
});
I need to filter this array and return only one, the one with the name property equal to some string, when I add the filter operator to the pipe nothing happens, I suppose nothing is filtered:
this.cacheService.getMainCache().pipe(map(val => val.list), filter((item: any) => item.name == 'profile')).subscribe((val) => {
console.log(val);
}, (error) => {
console.log('Error: ', error);
});
What am I doing wrong here?
