-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
finalize not working as expected with streams from dependencies #5237
Comments
I managed to workaround it: of(true).pipe(
switchMap(() => anotherModule$),
finalize(() => console.log('1. a finalized b')),
first()
).subscribe() But it's easy to forget to do this, leading to subtle bugs. |
|
Having different code depending on how/where code has been required makes it very difficult to pull RxJS code into shared libraries. This is where my issue is coming from. Even if this wouldn't be considered a bug, I'd really like you to consider removing any differences in behaviour based on where streams/code creating streams have been required from. |
Yeah. I was wrong; this is definitely a bug. I guess I really was tired, last night, as I recently fixed a problem that was closely related to this - see #5059 and the associated cherry pick into v6. That PR includes testing infrastructure that'll allow me to reproduce your problem in a failing test. After which, I'll fix it. Thanks for opening the issue. |
Bug Report
Current Behavior
Given project
a
andb
. Whena
subscribe to a stream fromb
, thefinalize
operator doesn't get called.The below script outputs:
Reproduction
https://github.com/cdanielw/rxjs-finalize
Expected behavior
Script should output :
Environment
The text was updated successfully, but these errors were encountered: