question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

startWith Deprecation warning

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Reactions:45
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

52reactions
orjandesmetcommented, May 28, 2019

The deprecation warning also disappears when typing the null in startWith. By default it’s typed any, so I guess the compiler doesn’t know it’s not meant to be a SchedulerLike.

startWith(<string>null); // In case your stream emits strings
32reactions
cartantcommented, May 12, 2019

The problem is related to the issue you referenced only in that some operators and observable creators that have signatures that include a Scheduler parameter have those signatures deprecated.

In your case, startWith(null) is matching this signature:

export function startWith<T>(scheduler: SchedulerLike): MonoTypeOperatorFunction<T>;

And it only matches that signature because you most likely have "strictNullChecks": false in your TypeScript configuration - either explicitly or implicitly.

Given that this is not a problem for in situations in which strictNullChecks are enabled, IMO, the deprecation should be left in place and a TSLint flag should be used to suppress the warning:

// tslint:disable-next-line:deprecation
startWith(null)
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found