rememberA2uiPreviewSurface

Functions summary

A2uiSurfaceModel
@Composable
rememberA2uiPreviewSurface(
    catalog: A2uiCatalog,
    jsonMessages: List<String>
)

Creates and remembers an A2uiSurfaceModel from raw A2UI JSON messages for Compose @Previews.

Functions

rememberA2uiPreviewSurface

@Composable
fun rememberA2uiPreviewSurface(
    catalog: A2uiCatalog,
    jsonMessages: List<String>
): A2uiSurfaceModel

Creates and remembers an A2uiSurfaceModel from raw A2UI JSON messages for Compose @Previews.

Creates a new A2uiSurfaceModel whenever catalog or jsonMessages changes and disposes of the previous one. The remembered surface is also disposed when this function leaves the composition.

Parameters
catalog: A2uiCatalog

A2uiCatalog defining the components available to this surface

jsonMessages: List<String>

list of raw JSON protocol messages, which must include a createSurface message

Returns
A2uiSurfaceModel

remembered A2uiSurfaceModel