Currently, I am facing the task of converting an Observable<string[]>
to an Observable<string>
I'm uncertain whether the mergeAll
operator is the solution for this scenario.
const o1: Observable<string[]> = of(['a', 'b', 'c']);
const o2: Observable<string> = o1.pipe(
mergeAll()
);
The error generated by TypeScript states:
Type 'Observable<string | string[]>' is not assignable to type 'Observable<string>'.
Type 'string | string[]' is not assignable to type 'string'.
Type 'string[]' is not assignable to type 'string'.
An Observable is passed as a parameter and the construction method can be altered.