of
emits a value after take(n)
should've already unsubscribed
#7366
Answered
by
voliva
OmerGronich
asked this question in
Q&A
-
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.
Answered by
voliva
Oct 30, 2023
Replies: 1 comment
-
I think this is expected:
I hope this explains it 🙏 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
OmerGronich
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this is expected:
of
emit all of the values synchronously.concatMap
keeps all of those emissions on a buffer, as it needs to run the map function for each one of them.concatMap
does the same: It will wait for a microtask to complete before moving to the next one.take(3)
will unsubscribe once the secondconcatMap
has emitted for the 3rd time.concatMap
had values on their buffer, so they will start mapping it before the secondconcatMap
emits the 3rd value.I hope this explains it 🙏