Skip to content

Conversation

nikku
Copy link
Member

@nikku nikku commented Feb 27, 2021

This adds the ability to attach commands to the previous undo/redo context.

By doing so I can execute things invisible to the user (from the undo/redo) perspective.

// given
commandStack.registerHandler('simple-command', SimpleCommand);

var context = { element: { trace: [] } };

commandStack.execute('simple-command', context, true);
commandStack.execute('simple-command', context, true);

// when
commandStack.undo();

// then
// both commands are undone

This adds the ability to attach commands to the previous undo/redo
context.

By doing so I can execute things invisible to the user (from the
undo/redo) perspective.

```javascript
// given
commandStack.registerHandler('simple-command', SimpleCommand);

var context = { element: { trace: [] } };

commandStack.execute('simple-command', context, true);
commandStack.execute('simple-command', context, true);

// when
commandStack.undo();

// then
// both commands are undone
```
@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Feb 27, 2021
@nikku nikku added backlog Queued in backlog and removed in progress Currently worked on labels Feb 27, 2021
@nikku nikku self-assigned this Feb 27, 2021
@philippfromme
Copy link
Contributor

Looks interesting, let me know if you think we should move forward with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backlog Queued in backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants