runGroup

fun <T> runGroup(signature: Any, inputs: Any? = RecomposeScope.NoInputs, reuseResult: (previous: T, next: T) -> Boolean? = null, block: (RecomposeScope) -> T): T(source)

Runs or reuses one positional group in the current composition scope.

signature and the active withKeys stack identify the group at its sibling position. A mismatch replaces that group and all following siblings at the drift point. Equal inputs permit reuse while the scope is clean; changed inputs mark the scope dirty. When the body does run, reuseResult may retain the previous result identity after comparing it with the newly calculated value.

Return

the cached, newly calculated, or explicitly reused group result

Parameters

signature

stable structural identity at the current sibling position

inputs

value compared with equals to detect explicit input changes

reuseResult

optional predicate returning true to retain the previous result instance

block

group body, receiving the opaque scope owned by this composer

Type Parameters

T

type of value cached for the group

Throws

when called outside an active composition attempt