mocheng/dissecting-rxjs

Cannot read property 'isStopped' of undefined

Opened this issue · 0 comments

不是本书的问题, 但是想请教一下作者

const source$ = Observable.create(({ next }) => {
  next(1)
  next(2)
  next(3)
})

source$.subscribe(console.log)

// 会报错误: TypeError: Cannot read property 'isStopped' of undefined
const source$ = Observable.create((observer) => {
  observer.next(1)
  observer.next(2)
  observer.next(3)
})

source$.subscribe(console.log)
// 运行正常: 1 2 3

不知作者知道内部到底是什么原因吗