# AdaptableSaveStateFunction

Canonical page: https://www.adaptabletools.com/docs/reference/adaptablesavestatefunction

Function that transforms state before persistence. Called first in the persistence flow, before `persistState()`.

The received state is the full persistent state of the current Adaptable instance (transient sections are already stripped).

```ts title="TypeScript"
export interface AdaptableSaveStateFunction 
```

## Calls

```ts title="TypeScript"
(state: AdaptablePersistentState, adaptableStateFunctionConfig: AdaptableStateFunctionConfig): AdaptablePersistentState;
```

###### Parameters

| Parameter | Type |
| --- | --- |
| state | [`AdaptablePersistentState`](https://www.adaptabletools.com/docs/reference/adaptablepersistentstate.md) |
| adaptableStateFunctionConfig | [`AdaptableStateFunctionConfig`](https://www.adaptabletools.com/docs/reference/adaptablestatefunctionconfig.md) |

###### Returns

[`AdaptablePersistentState`](https://www.adaptabletools.com/docs/reference/adaptablepersistentstate.md)
