Skip to content

Home work №2 Shebut Denis#249

Open
Kaizer22 wants to merge 1 commit intoOtus-Android:developmentfrom
Kaizer22:development
Open

Home work №2 Shebut Denis#249
Kaizer22 wants to merge 1 commit intoOtus-Android:developmentfrom
Kaizer22:development

Conversation

@Kaizer22
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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
Copy Markdown

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