UNPKG

@kvaser/canking-api

Version:

CanKing API to communicate with the CanKing service using Node.js.

44 lines (22 loc) 831 B
[**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.