Created
September 6, 2017 14:25
-
-
Save kozmi55/9380a64f977c0880d6e707269ea86362 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GetUsers(private val userRepository: UserRepository) { | |
fun execute(page: Int, forced: Boolean) : Single<List<UserViewModel>> { | |
val usersList = userRepository.getUsers(page, forced) | |
return usersList.map { userListModel: UserListModel? -> | |
val items = userListModel?.items ?: emptyList() | |
items.map { UserViewModel(it.userId, it.displayName, it.reputation, it.profileImage) } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment