---
title: "TwoWayConverter"
description: "Factory method to create a [TwoWayConverter] that converts a type [T] from and to an
[AnimationVector] type."
type: "function"
---

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


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


```kotlin
public fun <T, V : AnimationVector> TwoWayConverter(
    convertToVector: (T) -> V,
    convertFromVector: (V) -> T,
): TwoWayConverter<T, V>
```


Factory method to create a `TwoWayConverter` that converts a type `T` from and to an
`AnimationVector` type.

#### Parameters

| | |
| --- | --- |
| convertToVector | converts from type `T` to `AnimationVector` |
| convertFromVector | converts from `AnimationVector` to type `T` |




