【发布时间】:2020-03-12 18:17:07
【问题描述】:
//example 1
const xd = new Observable(({ next }) => {
next("3");
});
xd.subscribe(msg => console.log(msg));
//example 2
const obs$ = new Observable();
obs$.subscribe(mg => console.log(mg));
//example 3
private socket: SocketIOClient.Socket;
constructor(private url: string) {
this.socket = io(this.url);
}
listen() {
return new Observable(({ next }) => {
this.socket.on("message", next)
})
}
他们都给我同样的错误,可能出了什么问题?
(未捕获的类型错误:无法读取未定义的属性“isStopped”)
【问题讨论】:
标签: angular typescript rxjs