admin管理员组文章数量:1297112
I would like to quickly test some Observable related functions. In my Chrome Developper Tools (or the Firefox one, doesn't matter).
It seems to me that some days ago I was able to simply execute code like this :
var test$ = Rx.Observable.from([1,2,3]);
directly in my JavaScript console. My recollection seems even more correct since I actually have digged up this example (and many others) from my dev tools console history !
For some reason, it is not working anymore; I get this error :
Uncaught ReferenceError: Rx is not defined
or if I just use Observable instead of Rx.Observable
Uncaught ReferenceError: Observable is not defined
It is not possible to use import
statement 'as is' in the Chrome console. Does someone has a solution to debug RxJS code in using browser's Javascript console ?
I would like to quickly test some Observable related functions. In my Chrome Developper Tools (or the Firefox one, doesn't matter).
It seems to me that some days ago I was able to simply execute code like this :
var test$ = Rx.Observable.from([1,2,3]);
directly in my JavaScript console. My recollection seems even more correct since I actually have digged up this example (and many others) from my dev tools console history !
For some reason, it is not working anymore; I get this error :
Uncaught ReferenceError: Rx is not defined
or if I just use Observable instead of Rx.Observable
Uncaught ReferenceError: Observable is not defined
It is not possible to use import
statement 'as is' in the Chrome console. Does someone has a solution to debug RxJS code in using browser's Javascript console ?
- 1 I just created a website called rxjs.rxplayground.. It supports most major Rxjs version, has autoplete and you can stop your runaway subscriptions with the stop button. – Jensen Commented Sep 22, 2021 at 20:49
2 Answers
Reset to default 7UPDATE 2020-Dec :
RxJS in browser'sconsole is back!
Just go to https://rxjs.dev/ and open devtools console :)
____ _ ____
| _ \ __ __ | / ___|
| |_) |\ \/ / | \___ \
| _ < > < |_| |___) |
|_| \_\/_/\_\___/|____/
started experimenting with RxJS:
type this into the console:
rxjs.interval(500).pipe(rxjs.operators.take(4)).subscribe(console.log)
UPDATE 2018-Nov :
I just noticed that my previous answer (and the accepted one) is not valid anymore. The https://reactive.io site now redirects to https://rxjs-dev.firebaseapp./ and shows this :
____ _ ____
| _ \ __ __ | / ___|
| |_) |\ \/ / | \___ \
| _ < > < |_| |___) |
|_| \_\/_/\_\___/|____/
Open http://stackblitz. and try this code to get
started experimenting with RxJS:
import { interval } from "rxjs"
import { take } from "rxjs/operators"
const subscription = interval(500).pipe(take(4)).subscribe(console.log)
So now Stackblitz is the "official" way to go.
Original post :
After going back to the ReactiveX documentation, I had the confirmation by looking at this at the bottom :
Hint: open your DevTools to experiment with RxJS.
I simply forgot that this is available only if you open the dev tools from the reactivex.io/rxjs page itself :
The Rx Library is loaded when the site is loaded, you can access it directly reactive.io. This will work there
Rx.Observable.from([1,2,3]);
本文标签: javascriptHow do I use RxJS Observable in Chrome or Firefox developer tools consoleStack Overflow
版权声明:本文标题:javascript - How do I use RxJS Observable in Chrome or Firefox developer tools console? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741607743a2388074.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论