Created
October 11, 2021 14:59
-
-
Save tunjid/de0ccc9c079a64c6625e90cea3e55bea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SearchRepositoriesViewModel( | |
| … | |
| ) : ViewModel() { | |
| val state: StateFlow<UiState> | |
| val pagingDataFlow: Flow<PagingData<Repo>> | |
| init { | |
| … | |
| pagingDataFlow = searches | |
| .flatMapLatest { searchRepo(queryString = it.query) } | |
| .cachedIn(viewModelScope) | |
| state = combine(...) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment