RxJS 1 array item into sequence of single items - operator

前端 未结 5 586
一向
一向 2021-01-11 10:40

Given such observable

Rx.Observable.of([1,2,3,4,5])

which emits a single item (that is an array), what is the operator

5条回答
  •  攒了一身酷
    2021-01-11 11:20

    Dont understand why concatMap(x => x) or flatMap(x => x) works, it doesnt change anything. This should work (rxjs 6 or above):

    of([4,5,6]).pipe(mergeMap(from))
    

提交回复
热议问题