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

takeUntil doesn't work with ignoreElements #3016

Closed
ghost opened this issue Oct 28, 2017 · 3 comments
Closed

takeUntil doesn't work with ignoreElements #3016

ghost opened this issue Oct 28, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 28, 2017

RxJS version:
5.5.2

Code to reproduce:

const { Observable } = require( 'rxjs' );

const done = Observable.timer( 1000 ).ignoreElements();

done
.subscribe(
    console.log.bind( console, 'done next' ),
    console.log.bind( console, 'done error' ),
    console.log.bind( console, 'done complete' )
);

Observable.timer( 0, 100 )
.takeUntil( done )
.subscribe(
    console.log.bind( console, 'next' ),
    console.log.bind( console, 'error' ),
    console.log.bind( console, 'complete' )
);

Expected behavior:
Timer completes when done completes.

Actual behavior:
Done completes, but timer continues to emit items.

Additional information:
According to http://reactivex.io/documentation/operators/takeuntil.html:

The TakeUntil subscribes and begins mirroring the source Observable. It also monitors a second Observable that you provide. If this second Observable emits an item or sends a termination notification, the Observable returned by TakeUntil stops mirroring the source Observable and terminates.

@ghost
Copy link
Author

ghost commented Oct 28, 2017

Just noticed this is a duplicate of #2160.

@benlesh
Copy link
Member

benlesh commented Oct 30, 2017

Yeah.. this is to be expected.

complete isn't a single that you have something to use... it's a signal that you're not going to get anything to use. We really just need the docs to be updated, I think.

@benlesh benlesh closed this as completed Oct 30, 2017
@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant