Published
Edited
Jul 7, 2018
7 stars
Insert cell
Insert cell
Insert cell
observeRx = observable =>
Generators.observe(
next => observable.subscribe(
output => next(output)
)
)
Insert cell
Insert cell
observeRx(Rx.from([1,2,3]))
Insert cell
Insert cell
Insert cell
Insert cell
observeRx(Rx.interval(1000))
Insert cell
Insert cell
Insert cell
observeRx(
Rx.range(0,50).pipe(
Rx.operators.delay(1000),
Rx.operators.timeInterval(),
Rx.operators.startWith(md`no values yet`)))
Insert cell
Insert cell
Insert cell
observeRx(
Rx.range(0,50).pipe(
Rx.operators.mergeMap(i => Rx.of(i).pipe(Rx.operators.delay(1000))),
Rx.operators.timeInterval(),
Rx.operators.startWith(md`no values yet`)))
Insert cell
Insert cell
Insert cell
observeRx(
Rx.range(0,50).pipe(
Rx.operators.mergeMap(i => Rx.of(i).pipe(Rx.operators.delay((i+1)*1000))),
Rx.operators.timeInterval(),
Rx.operators.startWith(md`no values yet`)))
Insert cell
Insert cell
Insert cell
observeRx(
Rx.range(0,50).pipe(
Rx.operators.concatMap(i => Rx.of(i).pipe(Rx.operators.delay(1000))),
Rx.operators.timeInterval(),
Rx.operators.startWith(md`no values yet`)))
Insert cell
Insert cell
Insert cell
observeRx(
Rx.zip(
Rx.range(0,50),
Rx.interval(1000),
(a,b) => a).
pipe(
Rx.operators.timeInterval(),
Rx.operators.startWith(md`no values yet`)))
Insert cell
Insert cell
Insert cell
observeRx(
Rx.combineLatest(
Rx.range(0,50),
Rx.interval(1000),
(a,b) => [a,b]).
pipe(
Rx.operators.timeInterval(),
Rx.operators.startWith(md`no values yet`)))
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more