map

inline fun <SourceT : Screen, TransformedT : Screen> ScreenViewFactory<TransformedT>.map(noinline transform: (wrapperScreen: SourceT) -> TransformedT, crossinline prepEnvironment: (environment: ViewEnvironment) -> ViewEnvironment = { e -> e }, crossinline prepContext: (environment: ViewEnvironment, context: Context) -> Context = { _, c -> c }, crossinline showSource: (view: View, source: SourceT, transform: (wrapperScreen: SourceT) -> TransformedT, environment: ViewEnvironment, showTransformed: (TransformedT, ViewEnvironment) -> Unit) -> Unit = { _, src, xform, e, showTransformed -> showTransformed(xform(src), e) }): ScreenViewFactory<SourceT>

Transforms a ScreenViewFactory of TransformedT into one that can handle instances of SourceT.

See also