mapToUserNewsResources converts List<NewsResource> to List<UserNewsResource>

Change-Id: I072effef0f66caf51227ba8c64f0857fb837308d
pull/521/head
Don Turner 2 years ago
parent 24df51349d
commit 6207fe3bcf

@ -19,6 +19,7 @@ package com.google.samples.apps.nowinandroid.core.domain
import com.google.samples.apps.nowinandroid.core.data.repository.NewsRepository
import com.google.samples.apps.nowinandroid.core.data.repository.UserDataRepository
import com.google.samples.apps.nowinandroid.core.domain.model.UserNewsResource
import com.google.samples.apps.nowinandroid.core.domain.model.mapToUserNewsResources
import com.google.samples.apps.nowinandroid.core.model.data.NewsResource
import com.google.samples.apps.nowinandroid.core.model.data.UserData
import javax.inject.Inject
@ -55,7 +56,5 @@ private fun Flow<List<NewsResource>>.mapToUserNewsResources(
): Flow<List<UserNewsResource>> =
filterNot { it.isEmpty() }
.combine(userDataStream) { newsResources, userData ->
newsResources.map { newsResource ->
UserNewsResource(newsResource, userData)
}
newsResources.mapToUserNewsResources(userData)
}

Loading…
Cancel
Save