MutableState
-
Cmn
interface MutableState<T : Any?> : State
MutableDoubleState |
A value holder where reads to the |
MutableFloatState |
A value holder where reads to the |
MutableIntState |
A value holder where reads to the |
MutableLongState |
A value holder where reads to the |
ProduceStateScope |
Receiver scope for use with |
SnapshotMutableState |
A mutable value holder where reads to the |
A mutable value holder where reads to the value
property during the execution of a Composable
function, the current RecomposeScope
will be subscribed to changes of that value. When the value
property is written to and changed, a recomposition of any subscribed RecomposeScope
s will be scheduled. If value
is written to with the same value, no recompositions will be scheduled.
See also | |
---|---|
State |
|
mutableStateOf |
Summary
Public functions |
||
---|---|---|
operator T |
Cmn
|
|
operator (T) -> Unit |
Cmn
|
Public properties |
||
---|---|---|
T |
Cmn
|
Extension functions |
||
---|---|---|
inline operator Unit |
<T : Any?> MutableState<T>.setValue( Permits property delegation of |
Cmn
|
Public functions
Public properties
Extension functions
setValue
inline operator fun <T : Any?> MutableState<T>.setValue(
thisObj: Any?,
property: KProperty<*>,
value: T
): Unit
Permits property delegation of var
s using by
for MutableState
.
import androidx.compose.material.Button import androidx.compose.material.Text import androidx.compose.runtime.State import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember var count by remember { mutableStateOf(0) } Text(text = "You clicked $count times") Button(onClick = { count = count + 1 }) { Text("Click me") }