TypeScript Version: 3.4.4
Search Terms:
ReactiveX/rxjs#4718
Code
{
"scripts": {
"dev": "ts-node ."
},
"dependencies": {
"axios": "^0.18.0",
"rxjs": "^6.4.0",
"ts-node": "^8.1.0",
"typescript": "^3.4.4"
}
}
import * as rxjs from "rxjs";
import axios from "axios"
interface res {
data: any[],
count: number
}
let promiseSource$ = rxjs.from(axios.get<res>("http://govapi.pinza.com.cn/newsList"))
promiseSource$.subscribe((res) => { console.log(res.data.count) })
Expected behavior:
compiled
the answer
ReactiveX/rxjs#4718 (comment)
It's working in the IDE - TypeScript is inferring the type of data - so the problem is most likely related to the version of TypeScript that you are using with ts-node, etc.
In short, this does not seem to be an issue with RxJS.
Actual behavior:

Related Issues:
ReactiveX/rxjs#4718