我想合并两个相同来源的地图,以保证结果的顺序。这是我想通过的单元测试:
const source = xs.of(1,2,3)
const a = source.map(v=>v*10)
const b = source.map(v=>v*100)
const hist:number[] = []
xs.merge(a,b).addListener({
next: v=>hist.push(v),
})
expect(hist).toEqual([10,100,20,200,30,300])
目前我得到的结果是这样的:
Expected value to equal:
[10, 100, 20, 200, 30, 300]
Received:
[10, 20, 30, 100, 200, 300]