You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would there be an interest in having something along the lines of the below in the project? It's just an extension for converting List<Single> to Single<List> via an extension function. There could even be a better way of doing this with Rx but I'm yet to find one. Obvs you could do this for types other than Single as well.
fun <T> List<Single<T>>.zipSingles(): Single<List<T>> {
if (this.isEmpty()) return Single.just(emptyList())
return Single.zip(this) {
@Suppress("UNCHECKED_CAST")
return@zip (it as Array<T>).toList()
}
}
The text was updated successfully, but these errors were encountered:
tttcowan
changed the title
Extension function for List<Single<T>> and others?
Extension function for List<Single<T>> to Single<List<T>>
Jan 13, 2019
Would there be an interest in having something along the lines of the below in the project? It's just an extension for converting List<Single> to Single<List> via an extension function. There could even be a better way of doing this with Rx but I'm yet to find one. Obvs you could do this for types other than Single as well.
The text was updated successfully, but these errors were encountered: