You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import {AsyncSubject} from 'rxjs/Rx';
export class ShouldWork {
subject: AsyncSubject<boolean> = new AsyncSubject<boolean>().map(t => t);
}
Expected behavior:
Should not throw typescript error. Should know that return type is a subject not observable. Actual behavior:
severity: 'Error'
message: 'Type 'Observable' is not assignable to type 'AsyncSubject'.
Property 'value' is missing in type 'Observable'.' Additional information:
Occurs on Typescript versions: 2.4.0, 2.4.1, 2.5.3
Occurs even with --noStrictGenericChecks
The text was updated successfully, but these errors were encountered:
It is currently known expected design of extended variant of observable doesn't carry over its characteristics via operator chain by creating new observables. Similar, or possible dupe of #2378.
This only seems partially true to me, as all of the characteristics from my return object are carried over via operator chain except for .value. I know there is a reason for this, but it is a big bummer that you can't use typescript with AsyncSubject because it thinks it is returning an Observable when it isn't.
RxJS version:
5.5.0
Code to reproduce:
Expected behavior:
Should not throw typescript error. Should know that return type is a subject not observable.
Actual behavior:
severity: 'Error'
message: 'Type 'Observable' is not assignable to type 'AsyncSubject'.
Property 'value' is missing in type 'Observable'.'
Additional information:
Occurs on Typescript versions: 2.4.0, 2.4.1, 2.5.3
Occurs even with --noStrictGenericChecks
The text was updated successfully, but these errors were encountered: