[**Kvaser CanKing GUI Extensions SDK v7.5.1**](../../README.md)

***

[Kvaser CanKing GUI Extensions SDK](../../modules.md) / [hooks](../README.md) / useUndoSessionDataSlice

# Function: useUndoSessionDataSlice()

> **useUndoSessionDataSlice**\<`T`\>(`id`, `slice`, `initialState?`): \[[`IUndoObject`](../interfaces/IUndoObject.md)\<`T`\>, `boolean`\]

Custom hook to manage undo/redo state using session data storage.

## Type Parameters

### T

`T`

## Parameters

### id

`number`

The unique id of the view.

### slice

`string`

The slice name for the session data.

### initialState?

[`IUndoState`](../interfaces/IUndoState.md)\<`T`\>

The initial undo state.

## Returns

\[[`IUndoObject`](../interfaces/IUndoObject.md)\<`T`\>, `boolean`\]

[undoObject, loaded] - An undo object for managing state history and loaded flag.
