I am doing a simple http call and getting an array of objects
getFruit():Observable<Fruit[]> {
return this.http.get<Fruit[]>(URL);
}
the fruit object is
export class Fruit {
public name: string;
public color: string;
}
the problem code is below when i try to group or do anything in the pipe:
fruitService.getFruit().pipe(
groupBy(f => f.color),
mergeMap(group => group.pipe(toArray()))
);
however when i try to use rxjs groupBy i get errors;
Property 'color' does not exist on type 'Fruit[]'