to infinite many values (next) • A notification that there are no more values (complete) • A notification that an error happened during production of the values (error)
◦ buffer, window, audit • We need to provide a threshold • They don't solve an issue with large amount of DOM elements in an easy way ◦ Threshold needs to be adjusted after each data load and we can never be sure that we did it the right way • What is the solution? ◦ IntersectionObserver • RxJS doesn't have out-of-the-box solution to create an IntersectionObserver Observable
events ◦ I loaded data from server and I tracked loading state ◦ I handled events from QueryList (I suggest using MutationObserver which is natively supported by modern browsers) ◦ I subscribed to IntersectionObserver events ◦ I tracked changes in filters • Work backwards ◦ feed$ Observable was written once and extended as needed ◦ loadMore$ and filterChange$ Subject were added ◦ and loading$ Observable in the end • Factor out your Observables - there's no need to use factory functions (like I did here) • But, what about resources? ◦ async pipe ◦ takeUntil (just in case)
question ◦ https://stackoverflow.com/q/60155426/1253279 • If you'd like to contribute to RxJS-u: ◦ https://github.com/ReactiveX/rxjs • My Twitter (quite inactive) profile: ◦ https://twitter.com/jakovljevicMla