I think this flatMapLatest reference is part of an older version of this codelab, along with the following explanation in step 7:
The UiAction.Scroll Flow has some extra transformations applied to it. Let's go over them:
shareIn: This is needed because when this Flow is ultimately consumed, it is consumed using a flatmapLatest operator. Each time the upstream emits, flatmapLatest will cancel the last Flow it was operating on, and start working based on the new flow it was given.
https://github.com/googlecodelabs/android-paging/blob/0e8c7973826cbb1d131d2494816356b1569bf4e1/app/src/main/java/com/example/android/codelabs/paging/ui/SearchRepositoriesViewModel.kt#L73
I think this flatMapLatest reference is part of an older version of this codelab, along with the following explanation in step 7:
The UiAction.Scroll Flow has some extra transformations applied to it. Let's go over them:
shareIn: This is needed because when this Flow is ultimately consumed, it is consumed using a flatmapLatest operator. Each time the upstream emits, flatmapLatest will cancel the last Flow it was operating on, and start working based on the new flow it was given.