I have a RxJS5 pipeline looks like this
Rx.Observable.from([2, 3, 4, 5, 6])
.takeWhile((v) => { v !== 4 })
I want to keep the subscrip
You can use endWith(value) which (unlike a lot of RxJS code)
is very nicely self documenting.
const example = source.pipe(
takeWhile(val => val != 4),
endWith(4));
PS. Also note that takeUntil doesn't take a predicate, so if you were trying to use that operator to solve this problem you can't. It's a whole different method signature.
Official docs: https://rxjs-dev.firebaseapp.com/api/operators/endWith
https://stackblitz.com/edit/typescript-pvuawt