Skip to content

Instantly share code, notes, and snippets.

@tunjid
Last active October 11, 2021 15:06
Show Gist options
  • Select an option

  • Save tunjid/ffd7fcbb6303f094c067771696f96d00 to your computer and use it in GitHub Desktop.

Select an option

Save tunjid/ffd7fcbb6303f094c067771696f96d00 to your computer and use it in GitHub Desktop.
private fun ActivitySearchRepositoriesBinding.bindState(
uiState: StateFlow<UiState>,
pagingData: Flow<PagingData<Repo>>,
uiActions: (UiAction) -> Unit
) {
val repoAdapter = ReposAdapter()
list.adapter = repoAdapter.withLoadStateHeaderAndFooter(
header = ReposLoadStateAdapter { repoAdapter.retry() },
footer = ReposLoadStateAdapter { repoAdapter.retry() }
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment