Since updating to RXJS version 6 my WebStorm editor has been complaining on some usages of startWith() that the operator is marked as deprecated.
You can see in the source code that the methods are marked deprecated:
The problem for me is that the deprecated warning is not consistent. Sometimes it reports the method deprecated and other times it does not. While I can reproduce the warning in the below code examples. It seems to happen in my own source code randomly.
Not deprecated:
of(false).pipe(startWith(true));
Is marked deprecated:
const x: any = true;
of(false).pipe(startWith(x));
So I am worried about these deprecated warnings. The deprecation message says to use scheduled()
and concat()
operators instead, but that feels like a more complicate alternative to an already handy operator like startWith()
.
So I'm kind of confused as to why it's deprecated, but also why it's only deprecated sometimes.