Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created September 11, 2024 02:42
Show Gist options
  • Save skydoves/128d742a179b3d85cc54070b086fe8d1 to your computer and use it in GitHub Desktop.
Save skydoves/128d742a179b3d85cc54070b086fe8d1 to your computer and use it in GitHub Desktop.
consume_version
@Composable
fun UiComponent.Consume(
modifier: Modifier = Modifier,
version: UiVersion = UiVersion.VERSION_1_0,
navigator: (UiComponent) -> Unit = {}
) {
when (this) {
is TextUi -> ConsumeTextUi(
textUi = this,
modifier = modifier,
version = version
)
is ImageUi -> ConsumeImageUi(
imageUi = this,
modifier = modifier,
version = version,
navigator = navigator
)
..
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment