【发布时间】:2016-08-21 00:59:42
【问题描述】:
当我运行具有以下规范的新 JSBIN 项目时:
- 使用标签:JavaScript、控制台
- 添加库:RxJS 5.0.0
然后在JavaScript区运行如下代码块:
var observable = Rx.Observable.create(observer => {
setInterval(() => {
observer.onNext('This is the output of my async operation');
}, 2000);
});
observable.subscribe(response => console.log(response));
上述代码应在控制台区域呈现以下输出:
"This is the output of my async operation"
两秒钟后,控制台区域应该得到渲染:
"This is the output of my async operation"
但是,我收到以下错误:
"error"
-----------------------------
"ReferenceError: Rx is not defined
at yivicazake.js:3:4
at https://static.jsbin.com/js/prod/runner-3.39.12.min.js:1:13926
at https://static.jsbin.com/js/prod/runner-3.39.12.min.js:1:10855
这是我第一次使用 JSBIN 将 RxJS 作为库引入,我希望有人遇到过这个特殊错误。
【问题讨论】:
标签: javascript rxjs5 jsbin