Skip to content

Conversation

@Kaizer22
Copy link

No description provided.

Copy link

@makzimi makzimi left a comment

Choose a reason for hiding this comment

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

В целом всё ок. Но надо будет в будущем делать lifecycleScope и repeatOnLifecycle как я показал в примере.

Comment on lines +37 to +41
scope.launch {
catsViewModel.state.collectLatest { newState ->
view.render(newState)
}
}
Copy link

Choose a reason for hiding this comment

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

Так лучше не делать. Лучше использовать

    lifecycleScope.launch {
      repeatOnLifecycle(Lifecycle.State.STARTED) {
          ...
      }
    }

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