Kvaser CanKing GUI Extensions SDK v7.6.1


Kvaser CanKing GUI Extensions SDK / hooks / useUndoSessionDataSlice

Function: useUndoSessionDataSlice()

useUndoSessionDataSlice<T>(id, slice, initialState?): [IUndoObject<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<T>

The initial undo state.

Returns

[IUndoObject<T>, boolean]

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