# historyChanged

Emitted when undo/redo history changes. Update button availability and current depths.

Canonical: https://grid.syidax.com/docs/events/historyChanged/

<a id="meaning"></a>

## What does this API do?

Emitted when undo/redo history changes. Update button availability and current depths.

<a id="contract"></a>

## Exact input and result types

```typescript
historyChanged: GridHistoryChangedDetail
```

<a id="usage"></a>

## Usage flow

Subscribe with grid.addEventListener('historyChanged', handler). The result is in event.detail, and event names are case-sensitive. Remove subscriptions when disposing of the view.

```javascript
const controller = new AbortController();
grid.addEventListener('historyChanged', event => {
  console.log(event.detail);
}, { signal: controller.signal });
// On view disposal: controller.abort();
```

<a id="types"></a>

## Read related types

- [GridHistoryChangedDetail](https://grid.syidax.com/docs/types/GridHistoryChangedDetail.md)

<a id="recipes"></a>

## Feature explanations and examples

- [Edit history](https://grid.syidax.com/docs/features/undo-redo.md) — Undo or redo recorded editing transactions. One operation may contain multiple cell changes, so cell counts and history counts are not necessarily equal.
