# DynamicTypeValueReceiver

# DynamicTypeValueReceiver

Artifact:[androidx.wear.protolayout:protolayout-expression-pipeline](https://developer.android.com/jetpack/androidx/releases/wear-protolayout)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/expression/pipeline/DynamicTypeValueReceiver.java+class:androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeValueReceiver "View this page in Java")

<br />

```
interface DynamicTypeValueReceiver<T>
```

<br />

*** ** * ** ***

Callback for an evaluation result. This is intended to support two-step updates; first a notification will be sent that the evaluation result item will be updated, then the new evaluation result will be delivered. This allows downstream consumers to properly synchronize their updates if they depend on two or more evaluation result items, rather than updating multiple times (with potentially invalid states).  

| Parameters |
|------------|------------|
| `<T>`      | Data type. |

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onData](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/pipeline/DynamicTypeValueReceiver#onData(T))`(newData: T)` Called when the dynamic type that this callback was registered for has a new evaluation result. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onInvalidated](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/pipeline/DynamicTypeValueReceiver#onInvalidated())`()` Called when the dynamic type that this callback was registered for has an invalid result.    |

## Public functions

### onData

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
fun onData(newData: T): Unit
```

Called when the dynamic type that this callback was registered for has a new evaluation result.  

### onInvalidated

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
fun onInvalidated(): Unit
```

Called when the dynamic type that this callback was registered for has an invalid result.