# Any way to listen to undo from plugin?

**URL:** <https://forums.creativeclouddeveloper.com/t/any-way-to-listen-to-undo-from-plugin/1205>\
**Category:** UXP Plugin API\
**Tags:** undo, event, callback, api-feedback\
**Created:** [August 29, 2019, 4:23pm UTC](https://forums.creativeclouddeveloper.com/t/any-way-to-listen-to-undo-from-plugin/1205 "2019-08-29T16:23:12Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Velara](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/velara/32/1278_2.png) [@Velara](https://forums.creativeclouddeveloper.com/u/Velara)\
**Post date:** [August 30, 2019, 6:29pm UTC](https://forums.creativeclouddeveloper.com/t/any-way-to-listen-to-undo-from-plugin/1205/5 "2019-08-30T18:29:55Z")

</div>

That might work. You could also pass that information to the update callback.

> [@Determine type of update in the panel update method](http://forums.creativeclouddeveloper.com/t/determine-type-of-update-in-the-panel-update-method/1013):
>
> I’m running some possibly processor intensive events on update() and I want to run those events only if there is a change to the artboard. Right now, if I simply change the selection the update method is called. Use Case If the user moved an rectangle then I want to know that the document has changed. If the user simply selected a different rectangle then the document has not changed and I want to avoid running any specific operations. async update(type) { if (type=="selection") updateUI()…

In that feature request when update was called it would tell you what action initiated the call. You could probably have a second optional parameter that is if the action is undo or redo or first time.

```
function update(type, history) {
    if (type=="selection") {}
    if (type=="move" && history=="redo") {}
}

```

---

_[View the full topic](https://forums.creativeclouddeveloper.com/t/any-way-to-listen-to-undo-from-plugin/1205)._
