Cleanup resources and code
This commit is contained in:
@@ -11,6 +11,12 @@ import org.koitharu.kotatsu.core.model.MangaSource
|
||||
import org.koitharu.kotatsu.search.domain.MangaSearchRepository
|
||||
import org.koitharu.kotatsu.search.ui.suggestion.model.SearchSuggestionItem
|
||||
|
||||
private const val DEBOUNCE_TIMEOUT = 500L
|
||||
private const val SEARCH_THRESHOLD = 3
|
||||
private const val MAX_MANGA_ITEMS = 3
|
||||
private const val MAX_QUERY_ITEMS = 120
|
||||
private const val MAX_SUGGESTION_ITEMS = MAX_MANGA_ITEMS + MAX_QUERY_ITEMS + 1
|
||||
|
||||
class SearchSuggestionViewModel(
|
||||
private val repository: MangaSearchRepository,
|
||||
) : BaseViewModel() {
|
||||
@@ -83,13 +89,4 @@ class SearchSuggestionViewModel(
|
||||
suggestion.postValue(it)
|
||||
}.launchIn(viewModelScope + Dispatchers.Default)
|
||||
}
|
||||
|
||||
private companion object {
|
||||
|
||||
const val DEBOUNCE_TIMEOUT = 500L
|
||||
const val SEARCH_THRESHOLD = 3
|
||||
const val MAX_MANGA_ITEMS = 3
|
||||
const val MAX_QUERY_ITEMS = 120
|
||||
const val MAX_SUGGESTION_ITEMS = MAX_MANGA_ITEMS + MAX_QUERY_ITEMS + 1
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user