Last active
January 11, 2019 08:56
-
-
Save sanogueralorenzo/4094f2e5e3193d3c6965d2839e38ab98 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
data class CombinedUserPost(val user: User, val post: Post) | |
class UsersPostsUseCase @Inject constructor( | |
private val userRepository: UserRepository, | |
private val postRepository: PostRepository | |
) { | |
fun get(refresh: Boolean): Single<List<CombinedUserPost>> = | |
Single.zip(userRepository.get(refresh), postRepository.get(refresh), | |
BiFunction { userList, postList -> map(userList, postList) }) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment