field

fun <T> field(field: StateField<T>): T

Retrieve the value of a state field. Throws an error when the state doesn't have that field, unless you pass false as second parameter.


fun <T> field(field: StateField<T>, require: Boolean): T?

Retrieve the value of a state field, or null if the field is not present.