takeUntil will unsubscribe from the source whenever the notifying observable emits. takeWhile will unsubscribe whenever the predicate returns a falsy value. That means that takeWhile can only effect an unsubscription upon the source emitting a value.

RxJS core team member; front-end developer; mentor; speaker; open-source contributor

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store