takeUntil and takeWhile does not include last value.
Please see this post, there are links in the comments to other users having similar problems.
Describe the solution you’d like
Need option to get last value of takeUntil and takeWhile
Describe alternatives you’ve considered
Workaround is in stack overflow post but is not clean.