define

Define a StateField using a DSL builder.

val counter = StateField.define<Int> {
create { 0 }
update { value, tr -> value + 1 }
}