{"action":"closed","issue":{"url":"https://api.github.com/repos/flow-typed/flow-typed/issues/2617","repository_url":"https://api.github.com/repos/flow-typed/flow-typed","labels_url":"https://api.github.com/repos/flow-typed/flow-typed/issues/2617/labels{/name}","comments_url":"https://api.github.com/repos/flow-typed/flow-typed/issues/2617/comments","events_url":"https://api.github.com/repos/flow-typed/flow-typed/issues/2617/events","html_url":"https://github.com/flow-typed/flow-typed/issues/2617","id":349878092,"node_id":"MDU6SXNzdWUzNDk4NzgwOTI=","number":2617,"title":"RxJS 6 type Subject does not extend Observable","user":{"login":"wbyoung","id":57162,"node_id":"MDQ6VXNlcjU3MTYy","avatar_url":"https://avatars1.githubusercontent.com/u/57162?v=4","gravatar_id":"","url":"https://api.github.com/users/wbyoung","html_url":"https://github.com/wbyoung","followers_url":"https://api.github.com/users/wbyoung/followers","following_url":"https://api.github.com/users/wbyoung/following{/other_user}","gists_url":"https://api.github.com/users/wbyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/wbyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbyoung/subscriptions","organizations_url":"https://api.github.com/users/wbyoung/orgs","repos_url":"https://api.github.com/users/wbyoung/repos","events_url":"https://api.github.com/users/wbyoung/events{/privacy}","received_events_url":"https://api.github.com/users/wbyoung/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-13T03:39:17Z","updated_at":"2018-10-24T19:07:05Z","closed_at":"2018-10-24T19:07:05Z","author_association":"NONE","body":"In the [type definition of `Subject`](https://github.com/flow-typed/flow-typed/blob/2d80ca911ce40cfe448dfe102f3d55cf8446dfd5/definitions/npm/rxjs_v6.x.x/flow_v0.34.x-/rxjs_v6.x.x.js#L1553), `Observable` is simply mixed in rather than extending `Observable` [as is actually the case](https://github.com/ReactiveX/rxjs/blob/master/src/internal/Subject.ts#L22). This leads to type errors whenever using a subject as an argument where an `Observable` is expected.\r\n\r\nI came across this when using `combineLatest` and got the following error with Flow  0.67.1:\r\n\r\n```\r\nCannot call combineLatest with mySubject$ bound to _ because rxjs$Subject [1] is\r\nincompatible with undefined [2].\r\n\r\n     src/components/search.js\r\n [1]  193│   mySubject$: Subject<SomeType>;\r\n         :\r\n      220│     // ...\r\n      221│     const newObservable = stateObservable.pipe(\r\n      222│       switchMap((state: State) => (\r\n      223│         combineLatest(of(state.name), mySubject$)\r\n      224│       )),\r\n      225│       map(([name, instanceOfSomeType]: [string, SomeType]) => (\r\n      226│         // ...\r\n\r\n     flow-typed/npm/rxjs_v6.x.x.js\r\n [2] 1865│     combineLatest<+T, A>(a: rxjs$Observable<A>, _: void): rxjs$Observable<T> => rxjs$Observable<[T, A]>;\r\n```\r\n\r\nWhen I tried to change the definition to extend Observable (`declare class rxjs$Subject<T> extends rxjs$Observable<T> mixins rxjs$Observer<T>`, I got:\r\n\r\n```\r\nCannot extend super of rxjs$Subject [1] with rxjs$Subject because:\r\n • function type [2] requires another argument from function type [3] in property create.\r\n • rxjs$Observer [4] is incompatible with function type [5] in the first argument of property\r\n   create.\r\n\r\n [3]   40│   static create(\r\n [5]   41│     subscribe: (\r\n       42│       observer: rxjs$Observer<T>\r\n       43│     ) => rxjs$ISubscription | Function | void\r\n       44│   ): rxjs$Observable<T>;\r\n         :\r\n     1550│   call(subscriber: rxjs$Subscriber<R>, source: any): rxjs$TeardownLogic;\r\n     1551│ }\r\n     1552│\r\n [1] 1553│ declare class rxjs$Subject<T> extends rxjs$Observable<T> mixins rxjs$Observer<T> {\r\n [2] 1554│   static create<T>(\r\n [4] 1555│     destination: rxjs$Observer<T>,\r\n     1556│     source: rxjs$Observable<T>\r\n     1557│   ): rxjs$AnonymousSubject<T>;\r\n     1558│\r\n     1559│   asObservable(): rxjs$Observable<T>;\r\n     1560│   observers: Array<rxjs$Observer<T>>;\r\n     1561│   unsubscribe(): void;\r\n     1562│\r\n     1563│   // For use in subclasses only:\r\n     1564│   _next(value: T): void;\r\n     1565│ }\r\n     1566│\r\n     1567│ declare class rxjs$AnonymousSubject<T> extends rxjs$Subject<T> {\r\n     1568│   source: ?rxjs$Observable<T>;\r\n```\r\n\r\nAny thoughts on how to resolve this conflict and make the definition more correct?"}}
{"actor":{"display_login":"GAntoine"}}