setLastResult

fun setLastResult(result: R?)(source)

Set lastResult directly without touching the edited flag. Use for:

  • structural-edit invalidation: setLastResult(null) after the host has called markEdited separately

  • transform-and-replace: read lastResult.value, derive a new value, and write it back (e.g. Scenario's withoutScenario)

  • load-restored result with an independently-set edited flag

Passing null clears the result. Idempotent at the StateFlow level: writing the current value is a no-op.