// create side-effects to ensure that 'source' stream processes data only once
op.map(_=>++count),
op.take(20)
);
// ReplaySubject:
// All 20 events will arrive to both gen1 and gen2, but since we're subscribing to gen2 after delay the first 10 events will arrive there immediately after subscription
// turn notification objects into notification values
op.dematerialize()
)
)
{
constr=[];
RXall(_=>
rx.range(10).pipe(
// we can do arbitrary side-effects here
// similar to 'tap', but runs only on completion
op.finalize(_=>r.push('complete')),
op.mapTo('foo')
)
);
returnr;
}
RXall(_=>rx.of(1,2,3).pipe(op.repeat(3)))
RXall(_=>
rx.timer(100,1000).pipe(
op.timeInterval(),
op.pluck('interval'),
op.take(10)
)
)
RXall(
_=>
rx.of(3000,500,2000,1000,100).pipe(
op.concatMap(v=>
rx.of(`done ${v}`).pipe(
op.delay(v),
op.timeout(1000),
op.catchError(err=>rx.of(`timeout ${v}`))
)
)
),
{logMS:true}
)
rx
.of(1,2,3)
.pipe(op.delay(1000))
.toPromise()
import{rx,op,RX,RXall,RXlatest}from'@mblsha/rxjs'
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.