Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Until operator error - dispose of signal #428

Open
moczix opened this issue Mar 30, 2020 · 1 comment
Open

Until operator error - dispose of signal #428

moczix opened this issue Mar 30, 2020 · 1 comment

Comments

@moczix
Copy link

moczix commented Mar 30, 2020

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

@Frikki
Copy link
Member

Frikki commented Oct 7, 2020

Please provide a fully functional example. I cannot deduct what is happening in your MostStream implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants