replace

suspend fun replace(document: String)

Replaces the document the view is bound to (state and actions spec, Document replacement): the new document passes the gate under the surface's configuration, state whose declaration is unchanged (optionality included) carries over, the state data provider supplies the rest, and the swap lands on the dispatcher, serialized with dispatch. Throws what MilanoViewBuilder.build throws (the gate's typed errors, or the provider's own error, unchanged); on a throw the view is exactly as it was. Ignored silently after teardown.


suspend fun replace(document: ByteArray)

As replace with text, from raw UTF-8 bytes: the document-size limit is checked against them exactly.