Skip to content

Conversation

@Werechess
Copy link

Products Promo



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

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 -> {

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