stateful
Creates a Stateful
Return
Stateful wrapping initialValue
Parameters
initial Value
initial value that will be wrapped by Stateful
Returns Stateful of type T
This function can be used with by
syntax
var stateful : String by stateful("Example")
Content copied to clipboard
To update param created by stateful
simply write new value to it. This will lead to changes on platform side. Note that write operation to a field is not synchronized and synchronization is on user side.
var stateful : String by stateful("Example")
fun update() {
stateful = "Other example"
}
Content copied to clipboard
Receiver
Return
Stateful of type T
Parameters
initial Value
initial value of type T
Creates Stateful with provided initial value and callback set to one defined in StateHolder's Binder object.
Return
Stateful wrapping initialValue
Parameters
initial Value
initial value that will be wrapped by Stateful