Skip to content

feat: homework06#9

Open
Werechess wants to merge 1 commit into
Otus-Android:masterfrom
Werechess:master
Open

feat: homework06#9
Werechess wants to merge 1 commit into
Otus-Android:masterfrom
Werechess:master

Conversation

@Werechess

Copy link
Copy Markdown

Products Promo



data class SnackbarEvent(val message: String)
object SnackbarController {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно еще делать иначе, через функцию показа ошибки через параметры композабла (например, onShowError: (String) -> Unit). Это сделает компоненты более независимыми и тестируемыми. В компоуз предпочтительнее явная передача зависимостей через параметры, а не глобальные объекты

CircularProgressIndicator(modifier = Modifier.align(Alignment.Center))
}

state.hasError -> {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Логику можно вынести в общий композабл ErrorHandler, она у нас и в DetailsScreen дублируется

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants