Skip to content

basicarchitecture#37

Open
aksenovasmail-git wants to merge 2 commits intoAndroid-Developer-Basic:masterfrom
aksenovasmail-git:master
Open

basicarchitecture#37
aksenovasmail-git wants to merge 2 commits intoAndroid-Developer-Basic:masterfrom
aksenovasmail-git:master

Conversation

@aksenovasmail-git
Copy link

No description provided.

searchJob = viewLifecycleOwner.lifecycleScope.launch {
delay(500)
if (query.length >= 3) {
viewModel.getSuggestions(query)

Choose a reason for hiding this comment

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

Сейчас вы отменяете job во Fragment, но запрос создается во ViewModel, поэтому отмена не работает. Можно переносить debounce и отмену в ViewModel и использовать flatMapLatest, чтобы новые запросы отменяли старые

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

Comments