Reactive-Extensions / RxJS

The Reactive Extensions for JavaScript
http://reactivex.io
Other
19.49k stars 2.1k forks source link

takeUntil does not complete delay #1554

Closed MickL closed 6 years ago

MickL commented 6 years ago

It seems like i found some weird behavior. TakeUntil is not working in this context, so does debounceTime:

click$ is delayed but if doubleClick$ emits before 550ms click$ still emits a value. Also very weird: Replacing delay with debounceTime does have no delay at all.

click$
      .pipe(
        switchMap(event =>
          of(event)
            .pipe(
              delay(550),
              takeUntil(doubleClick$),
            )
        )
      )
      .subscribe(() => {
        console.log('click');
      })
    ;

RxJS: 5.5.2

MickL commented 6 years ago

Nevermind, works as designed but click is triggered twice of course and the second time doubeClick$ does not emit.