Shouldn't there be a "mergeTap"? #7320
ghost
started this conversation in
Ideas / Feature request
Replies: 1 comment 1 reply
-
|
I think the Example: interval(3000)
.pipe(
delayWhen(
() =>
new Promise<void>((resolve) =>
setTimeout(() => (console.log('inner'), resolve()), 2000)
)
)
)
.subscribe(console.log); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Imagine a series of operator functions, like
map,mergeMapetc. Usingtapalong the series works fine for synchronous tasks, but what if I want to perform an asynchronous action (before moving on to the next operator function), without modifying the piped value.If you do
console output will be
innerafterouter. Usingawaiton the inner promise won't make any difference.Of course, this would work:
but I don't like touching
valuethat I don't want to modify anyway.So what would be quite handy is some kind of
mergeTapoperator, which would be likemergeMapbut return the input value as is. I could then writeBeta Was this translation helpful? Give feedback.
All reactions