In this lesson we learn how to fetch new data whenever the refresh button is clicked. This lessons starts to give us a feeling of how is it do develop reactive applications in RxJS.
Hi Joshua, if we try to simply map a request URL to a response, we will get a stream of streams, because each response is a stream (since a response always comes asynchronously in the future). With a stream of streams, we can "flatten" it by using mergeAll. So map + mergeAll is what we would need to do. Actually, flatMap is precisely map + mergeAll. That's why we use flatMap.
I think the code is a little bit redundant here or at least it's not clear tom me why the random function is used twice. First in the requestOnRefreshStream and second in the suggestionStreams also. So to easy the code we could go with standard url in the requestORefreshStream and we still have "random" suggestions.