Breaking change in SwitchMap 6.3.3 -> 6.4.0
See original GitHub issueDocumentation Related To Component:
SwitchMap
Please check those that apply
- typo
- documentation doesn’t exist
- documentation needs clarification
- error(s) in example
- needs example
Description Of The Issue
Version 6.4.0 contains a breaking change when coming from 6.3.3 that is not mentioned in the CHANGELOG.md. The culprit is this change:
switchMap: support union type returns (32d35fd)
This introduced a breaking change if you used the generic types
Before:
switchMap<string, Foo[]>(...)
After:
switchMap<string, Observable<Foo[]>>(...)
I also spotted something odd here https://github.com/reactivex/rxjs/commit/32d35fd#diff-2890e8018eeca17541f08afe9bc0bc2eL9
The test says “should support a projector that takes an index” but the index parameter was removed. That doesn’t look right to me. I’m assuming prettier or something like that removed the unused parameter 🤔
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:5 (1 by maintainers)
Top Results From Across the Web
when I update rxjs from 6.3.3 to 6.4.0, I get the error: ...
After updating to rxjs 6.4.0, I get the error: ERROR TypeError: You provided an invalid object where a stream was expected. You can...
Read more >rxjs/CHANGELOG.md
272, ### BREAKING CHANGES. 273. 274, - **windowToggle:** the observable returned by the windowToggle operator's. 275, closing selector must emit a next ...
Read more >rxjs
This is a rewrite of Reactive-Extensions/RxJS and is the latest production-ready version of RxJS. This rewrite is meant to have better ...
Read more >@reactivex/rxjs | Yarn - Package Manager
0 (2018-03-16) ... BREAKING CHANGES. ajax: will no longer execute a CORS request by default, you must opt-in with the crossDomain flag in...
Read more >switchMap
Each time it observes one of these inner Observables, the output Observable begins emitting the items emitted by that inner Observable. When a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Core Team Meeting Notes
SInce using the generic arguments to cast is really an anti-pattern in TypeScript in general, We will:
pipechain when developers encounter problems, for example:It’s an issue for people, but the generics changes were to fix other bugs with typings in the library, and we don’t want to undo that, because we would be punishing people who were indeed using the library properly. So we’ll prioritize getting this new type out there and documenting it.
@snebjorn If you really need to provide an explicit type (instead of inferred) I suggest to specify it in the return type of the function:
instead of
use
it works in both 6.3.3 and 6.4.0