StateFieldBuilder
Builder scope for defining a StateField via DSL.
Example:
val counter = StateField.define<Int> {
create { 0 }
update { value, tr -> value + tr.changes.newLength }
}Content copied to clipboard
Functions
Link copied to clipboard
Set the function that creates the initial value for this field.
Link copied to clipboard
Provide an extension derived from this field (e.g. a facet provider).
Link copied to clipboard
Set type-safe serialization using a kotlinx.serialization.KSerializer.
Set custom JSON serialization for this field.
Link copied to clipboard
Set the function that updates the value on each transaction.