# AdaptableApplyStateFunction

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

Function that applies the loaded state to the application. Called after `loadState()` (and after the result was merged with `initialState`) but before the state is used.
This allows for any necessary transformations or adjustments before the state is applied.

The state is partial, as only the sections present in either the persisted state or `initialState` are available at this point; missing sections are initialised with their defaults afterwards.

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

## Calls

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

###### Parameters

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

###### Returns

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