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


<a id='references'></a>


<h2 id="mapsaver-save-restore">mapSaver</h2>

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


```kotlin
public fun <T> mapSaver(
    save: SaverScope.(value: T) -> Map<String, Any?>,
    restore: (Map<String, Any?>) -> T?,
): Saver<T, Any>
```


The `Saver` implementation which allows to represent your class as a map of values which can be
saved individually.

What types can be saved is defined by `SaveableStateRegistry`, by default everything which can be
stored in the Bundle class can be saved.

You can use it as a parameter for `rememberSaveable`.