Bug Report
Current Behavior
When using startWith inside of pipe, the argument type is not validated and/or the return type may be incorrect.
Reproduction
import { of } from 'rxjs';
import { startWith } from 'rxjs/operators';
import 'rxjs/Rx';
const ob2$ = of(1).startWith(
// Expect error, got one :-)
// Argument of type '"foo"' is not assignable to parameter of type 'number | SchedulerLike'.
'foo',
);
const ob$ = of(1).pipe(
startWith(
// Expected error, but got none :-(
'foo',
),
);
// OR, if we don't get an error, we should at least get a union:
// $ExpectType Observable<number | string>
// but got actual type Observable<{}>
ob$;
Expected behavior
When using startWith inside of pipe, I would expect either:
- the argument type must match the
Observable's inner type
- the return type should be a union of the
Observable's inner type and the argument type
Environment
- Runtime: no runtime, purely type level
- RxJS version: 6.2.2
Possible Solution
Additional context/Screenshots
Related #2544
Bug Report
Current Behavior
When using
startWithinside ofpipe, the argument type is not validated and/or the return type may be incorrect.Reproduction
Expected behavior
When using
startWithinside ofpipe, I would expect either:Observable's inner typeObservable's inner type and the argument typeEnvironment
Possible Solution
Additional context/Screenshots
Related #2544