function componentA(sources$) {
return {
dom$: ...,
http$: ...
}
}
function componentB(sources$) {
return {
dom$: ...,
http$: ...
}
}
function main(sources$) {
sources$.props.pipe(
switchMap(props=> {
if (props.showA) {
const sinksA$ = componentA(sources$);
} else {
const sinksB$ = componentB(sources$);
}
})
)
return {
// how to make dom$ and htttp$ ?
}
}
So how can I merge two different streams separately?
This may accomplish what you are trying to achieve:
Let me know if you need more explanation than this example code.