Created
August 31, 2020 21:15
-
-
Save Foso/b277c86a8dab0a522d7cdf2b4cfce6db to your computer and use it in GitHub Desktop.
PreviewParameterCombiner from https://youtu.be/exjL2kGPngI?t=696
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
/** | |
* A [PreviewParameterProvider] that combines two providers. The output will be a [Pair] containing | |
* both Results | |
*/ | |
open class PreviewParameterCombiner<T, U>( | |
private val provider: Pair<PreviewParameterProvider<T>, PreviewParameterProvider<U>> | |
) : PreviewParameterProvider<Pair<T, U>> { | |
override val values: Sequence<Pair<T, U>> | |
get() = provider.first.values.flatMap { first -> | |
provider.second.values.map { second -> | |
first to second | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment