consider this example:
export class AppComponent {
private _destroy$ = new MostStream<void>();
private example$ = new MostStream<void>();
private example1$: Stream<any> = R.piped(
this.example$,
tap(d => console.log('test', d)),
until(this._destroy$)
)
start() {
console.log('start');
runEffects(tap(d => console.log('got 1', d), this.example1$), newDefaultScheduler());
runEffects(tap(d => console.log('got 2', d), this.example1$), newDefaultScheduler());
}
end() {
console.log('end');
this._destroy$.add(null);
}
push() {
console.log('push')
this.example$.add(null);
}
}
MostStream is my implementation of streams for your lib. Click on start, then click on push and then on end. What happend? only first runEffects will be ended due to until operator.
why? because of this:
const d1 = this.source.run(sink, scheduler)
const d2 = this.maxSignal.run(new UntilSink(sink, disposable), scheduler)
disposable.setDisposable(disposeBoth(d1, d2))
you dispose both, source and signal. Is it bug? or feature?
in rxjs only the source is disposed
consider this example:
MostStream is my implementation of streams for your lib. Click on start, then click on push and then on end. What happend? only first runEffects will be ended due to until operator.
why? because of this:
you dispose both, source and signal. Is it bug? or feature?
in rxjs only the source is disposed