rxjs: takeUntil docs wrong.
EDIT: (blesh) We need to update the docs
The docs should describe the behavior when the notifier passed to takeUntil
does not emit, and instead completes. (for example, Observable.empty()
or Observable.timer(100).ignoreElements()
)
Original Post
takeUntil
on reactivex.io states
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.
(emphasise is mine)
Similar, the docs state:
takeUntil
subscribes and begins mirroring the source Observable. It also monitors a second Observable,notifier
that you provide. If thenotifier
emits a value or a complete notification, the output Observable stops mirroring the source Observable and completes.
(emphasise is mine)
However, in the specs:
it('should take all values when notifier is empty', function () {
I think the correct behaviour would be to terminate when the notifier
terminates, however at the very least the docs should be in line with the specs.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 5
- Comments: 24 (13 by maintainers)
Commits related to this issue
- fix(takeUntil): complete an observable when notifier completes Closes #2160 — committed to DzmitryShylovich/rxjs by DzmitryShylovich 7 years ago
Hey! We discussed this today at our meeting, notes here. We’d like to keep the status quo as far as behavior, but certainly the docs could call out this behavior explicitly, to prevent any confusion.
@Karasuni it’ll be a combination of the two once the docs project is complete - but yes the docs will be generated from the annotated code.
@benlesh this issue is about the takeuntil docs being wrong, not out of sync with the stable.
Sounds like a good idea to keep this open until the extra pr has been made + merged, as the take until docs are still wrong.
I can try to take a stab at it any time soon, if others want, feel free to do so.
@errorx666 would you be interested in contributing?
I’ve updated the title of this issue and edited the original post to include the intention of what we need to do to resolve the issue.
For what it is worth. Rx.Net does not terminate on
empty
. RxJava does terminate onempty
. That might explain why reactivex.io is confused on the subject.