startWith Deprecation warning
See original GitHub issueI can’t find any documentation on what is actually deprecated, but I believe this is related to: https://github.com/ReactiveX/rxjs/issues/4723.
Bug Report
Current Behavior
startWith is deprecated: use {@link scheduled} and {@link concatAll} (e.g. scheduled([[a, b, c], source], schedul er).pipe(concatAll()))
Reproduction
startWith(null);
Expected behavior No deprecation warning
Environment
- RxJS version: 6.5.2
Issue Analytics
- State:
- Created 4 years ago
- Reactions:45
- Comments:17 (1 by maintainers)
Top Results From Across the Web
Is the startWith operator in RXJS really deprecated?
Highly likely, you are using startWith(null) or startWith(undefined) , they are not deprecated despite the notice, but IDE detects a wrong ...
Read more >The Complete Guide for Deprecation Warnings in Rails
In Rails, all deprecation warnings start with DEPRECATION WARNING: , so you can search for that string in your logs.
Read more >Is the startWith operator in RXJS really deprecated?-rx.js
Highly likely, you are using startWith(null) or startWith(undefined) , they are not deprecated despite the notice, but IDE detects a wrong function ...
Read more >Enhanced Deprecation - Java - Oracle Help Center
If the deprecation is forRemoval=true , the compiler generates a "removal warning". The two kinds of warnings are controlled by separate -Xlint flags:...
Read more >Handling Deprecations - Configuration - Ember Guides
You might notice that you have a lot of duplicated messages in your workflow file, like the 3 messages in the above example...
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

The deprecation warning also disappears when typing the
nullin startWith. By default it’s typedany, so I guess the compiler doesn’t know it’s not meant to be a SchedulerLike.The problem is related to the issue you referenced only in that some operators and observable creators that have signatures that include a
Schedulerparameter have those signatures deprecated.In your case,
startWith(null)is matching this signature:And it only matches that signature because you most likely have
"strictNullChecks": falsein your TypeScript configuration - either explicitly or implicitly.Given that this is not a problem for in situations in which
strictNullChecksare enabled, IMO, the deprecation should be left in place and a TSLint flag should be used to suppress the warning: