Skip to content
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

fix(forkJoin): the first empty source will now cause an EmptyError #7266

Merged
merged 1 commit into from May 25, 2023

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented May 19, 2023

BREAKING CHANGE: forkJoin will no longer just complete if a source completes without a value. Instead you will get an error of EmptyError. If you want to complete in this case, add catchError(() => EMPTY) to the forkJoin... however, if you just want to default the sources of your forkJoin to some other value if they're empty, apply the defaultIfEmpty operator. for example, forkJoin(sources.map(defaultIfEmpty(null))).

resolves #5561

@benlesh benlesh added the 8.x Issues and PRs for version 8.x label May 19, 2023
BREAKING CHANGE: `forkJoin` will no longer just complete if a source completes without a value. Instead you will get an error of `EmptyError`. If you want to complete in this case, add `catchError(() => EMPTY)` to the forkJoin... however, if you just want to default the sources of your `forkJoin` to some other value if they're empty, apply the `defaultIfEmpty` operator. for example, `forkJoin(sources.map(defaultIfEmpty(null)))`.

resolves ReactiveX#5561
@benlesh benlesh force-pushed the fix-5561_forkJoin-early-complete branch from 03f0e25 to 82184b2 Compare May 25, 2023 14:20
@benlesh benlesh merged commit 4ca507a into ReactiveX:master May 25, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Issues and PRs for version 8.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion: forkJoin completing early if any source completes without value
3 participants