-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support async command execution #39
Conversation
Change command API to support MaybePromise<void> instead of just plain voids. This enables async command execution e.g. for communicating with a modelserver Contributed on behalf of STMicroelectronics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good to me for the most part, thank you very much Tobias! I just have a question regarding the compound command.
@@ -108,12 +110,14 @@ export class CompoundCommand implements Command { | |||
const alreadyRedone: Command[] = []; | |||
|
|||
try { | |||
this.commands.forEach(command => { | |||
for (const command of this.commands) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not also await the redo
in the line below to make sure that the order is properly kept and there are no conflicts?
} catch (err) { | ||
alreadyRedone.forEach(command => command.undo()); | ||
for (const command of alreadyRedone) { | ||
command.undo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not also await the undo
here to make sure that the order is properly kept and there are no problems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Change command API to support
MaybePromise<void>
instead of just plain voids. This enables async command execution e.g. for communicating with a modelserverContributed on behalf of STMicroelectronics