Current Behavior
I've got the tslint rule "deprecation": true enabled and it is now throwing warnings when using of without a scheduler.
Reproduction
import { of } from "rxjs"
of(4) // of is deprecated: use {@link scheduled} instead `scheduled([a, b, c], scheduler)` (deprecation)
Expected behavior
No warning
Environment
As described here, only the version of "of" which accepts a scheduler should be deprecated: https://github.com/ReactiveX/rxjs/pull/4595 So, it's definitely a bug.
I think these two lines should be moved to the bottom of the declaration file
/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */
export declare function of<T>(...args: (T | SchedulerLike)[]): Observable<T>;
@evertbouw Yes, they need to be placed below:
export function of<T>(...args: T[]): Observable<T>;
@evertbouw If you would like to open a PR, please let me know. Otherwise, I'll open one myself.
@cartant I can do it
I see the same problem with startWith
@nlaplante If there is a problem with startWith it would be better to open another issue. This one will be closed when the PR is merged. Anyway, if there is a problem with that operator's deprecations, it appears to be to be different to this issue, as the signature is already in the correct place.
I have the same problem.
I see the same problem with
startWith
I had the problem with startWith when I was using startWith(void 0). I changed it to startWith(0) and now it works without showing any deprecation warning.
@imransilvake As mentioned above, please open a new issue and fill out the issue template.
@nlaplante Temporary workaround - use startWith as below:-
startWith<string>(null)
Basically remove ambiguity. It would be great if we don;t have to do this though.
Has this been fixed? The part with the 'of' function? It's giving me the worst time when trying to implement it with my ngrx
catchError(error => of({type: ErrorActionTypes.HANDLE_STATUS, payload: {status: error.status}}))
@jtbitt the PR is still open. Should be fixed in the next release I think. Personally I disabled the tslint rule, you can also downgrade RXJS to the previous version.
@evertbouw Thanks
Well, I might sound like a dick here. But ... it's a minor bug, that what fixed immediately after it's been spotted by (at least) hundreds ppl. 2 weeks passes and it's not released. I know, I know. Just a bit frustrating.
Most helpful comment
Well, I might sound like a dick here. But ... it's a minor bug, that what fixed immediately after it's been spotted by (at least) hundreds ppl. 2 weeks passes and it's not released. I know, I know. Just a bit frustrating.