of emits a value after take(n) should've already unsubscribed
#7366
-
|
Hello, I ran into the following behavior which seems like a bug. In this stream, I have a take(3) so I expected to see 3 logs from each concatMap. stackblitz link: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I think this is expected:
I hope this explains it 🙏 |
Beta Was this translation helpful? Give feedback.

I think this is expected:
ofemit all of the values synchronously.concatMapkeeps all of those emissions on a buffer, as it needs to run the map function for each one of them.concatMapdoes the same: It will wait for a microtask to complete before moving to the next one.take(3)will unsubscribe once the secondconcatMaphas emitted for the 3rd time.concatMaphad values on their buffer, so they will start mapping it before the secondconcatMapemits the 3rd value.I hope this explains it 🙏