---
title: "getValue"
description: "Permits property delegation of `val`s using `by` for [DoubleState]."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
public inline operator fun DoubleState.getValue(thisObj: Any?, property: KProperty<*>): Double
```


Permits property delegation of `val`s using `by` for `DoubleState`.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
public inline operator fun FloatState.getValue(thisObj: Any?, property: KProperty<*>): Float
```


Permits property delegation of `val`s using `by` for `FloatState`.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
public inline operator fun <T> State<T>.getValue(thisObj: Any?, property: KProperty<*>): T
```


Permits property delegation of `val`s using `by` for `State`.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
public inline operator fun IntState.getValue(thisObj: Any?, property: KProperty<*>): Int
```


Permits property delegation of `val`s using `by` for `IntState`.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
public inline operator fun LongState.getValue(thisObj: Any?, property: KProperty<*>): Long
```


Permits property delegation of `val`s using `by` for `LongState`.



## Code Examples
### DelegatedReadOnlyStateSample
```kotlin
@Composable
fun DelegatedReadOnlyStateSample() {
    // Composable function that manages a subscription to a data source, returning it as State
    @Composable fun observeSampleData(): State<String> = TODO()
    // Subscription is managed here, but currentValue is not read yet
    val currentValue by observeSampleData()
    Row {
        // This scope will recompose when currentValue changes
        Text("Data: $currentValue")
    }
}
```

