如何将所有数组添加到RXJ中的一个数组
如何将所有数组添加到此代码的RXJ中的一个数组?
someObs$ = this.getSomeData$().pipe(
mergeMap(res => res),
groupBy(el => el.class),
mergeMap(group$ => group$.pipe(toArray())),
// how in this place create something like this: [[{},{}], [{},{}], [{},{}]]
shareReplay(1)
)
感谢您的帮助
how i can add all arrays to one in rxjs for this code?
someObs$ = this.getSomeData$().pipe(
mergeMap(res => res),
groupBy(el => el.class),
mergeMap(group$ => group$.pipe(toArray())),
// how in this place create something like this: [[{},{}], [{},{}], [{},{}]]
shareReplay(1)
)
Thanks for help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了解决方案:操作员
toarray()
I found solution for this: operator
toArray()
rxjs doc的定义 toarray operator:
大理石图:

RxJS Doc definition of toArray operator:
Marble Diagram:
