refactor: extract number to a constant
All checks were successful
Android Unit Tests / tests (push) Successful in 7m6s
All checks were successful
Android Unit Tests / tests (push) Successful in 7m6s
This commit is contained in:
parent
1874f3a573
commit
a7c31bc48b
1 changed files with 2 additions and 2 deletions
|
@ -10,6 +10,7 @@ import kotlinx.coroutines.launch
|
|||
import xyz.leomurca.csgomatches.domain.model.Match
|
||||
import xyz.leomurca.csgomatches.domain.model.Resource
|
||||
import xyz.leomurca.csgomatches.domain.repository.MatchRepository
|
||||
import xyz.leomurca.csgomatches.utils.ApiDefaults.ITEMS_PER_PAGE
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
|
@ -54,14 +55,13 @@ class MatchesViewModel @Inject constructor(
|
|||
_uiState.value = current.copy(
|
||||
matches = current.matches + newMatches,
|
||||
isPaginating = false,
|
||||
endReached = newMatches.size < 20
|
||||
endReached = newMatches.size < ITEMS_PER_PAGE
|
||||
)
|
||||
|
||||
isLoadingNextPage = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sealed class MatchesUiState {
|
||||
data class Success(
|
||||
val matches: List<Match>,
|
||||
|
|
Loading…
Add table
Reference in a new issue