I am facing the challenge of flattening a nested Observable into a single observable array. The Observable looks like this:
Observable<Observable<any[]>[]> values;
The inner arrays have the following structure:
[
{id: 0, name: 'a'},
{id: 1, name: 'b'}
],
[
{id: 0, name: 'a'},
{id: 2, name: 'c'}
],
[
{id: 1, name: 'b'},
{id: 3, name: 'd'}
]
We need to transform this into an Observable<any[]>
, where the array should be combined as follows:
[
{id: 0, name: 'a'},
{id: 1, name: 'b'},
{id: 2, name: 'c'},
{id: 3, name: 'd'}
]
If anyone has any insight on how to accomplish this task, please share your expertise.