Instead of writing complex operators, it's usually best to write simple, single-purpose operators then chain them together when necessary. The pipe
function takes functions as arguments, invokes each function with the value, then passes the returned result on to the next function.
It's hard for me to wrap my head around why it's not necessary to do the whole source.lift
routine here. My best guess is that it's because we're replacing something (pipe
) out of rxjs
proper, rather than an operator
. What we're passing into our custom pipe
is always an operator
and does have to follow that pattern, so presumably our "normal" JS here is just chaining the results of each of those source.lift
s together.