Skip to content
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

CommandCollection and Editor.execute should return a result. #7647

Closed
tomalec opened this issue Jul 20, 2020 · 0 comments · Fixed by #7651
Closed

CommandCollection and Editor.execute should return a result. #7647

tomalec opened this issue Jul 20, 2020 · 0 comments · Fixed by #7651
Assignees
Labels
domain:dx This issue reports a developer experience problem or possible improvement. package:core type:improvement This issue reports a possible enhancement of an existing feature.

Comments

@tomalec
Copy link
Contributor

tomalec commented Jul 20, 2020

📝 Provide a description of the improvement

editor.execute, CommandCollection.execute should/could return the command.execute value

this.commands.execute( ...args );

The current setup makes testing async commands complicated, as I cannot write

await buttonView.fire( 'execute' );

expect( something ).to.be.done.once.finally.executed;

It also introduces inconsistency, as I can do such things when calling command.execute directly
https://github.com/cksource/ckeditor5-internal/blob/233614fa4153c7cce92ff7f6b3304ba6b197aa8b/packages/ckeditor5-export-pdf/tests/exportpdfcommmand.js#L178-L180

📃 Other details

  • Browser: n/a
  • OS: n/a
  • CKEditor version: master@1c449932924
  • Installed CKEditor plugins: n/a

If you'd like to see this improvement implemented, add a 👍 reaction to this post.

@tomalec tomalec added type:improvement This issue reports a possible enhancement of an existing feature. squad:red domain:dx This issue reports a developer experience problem or possible improvement. package:core labels Jul 20, 2020
tomalec added a commit that referenced this issue Jul 20, 2020
@tomalec tomalec self-assigned this Jul 20, 2020
jodator added a commit that referenced this issue Jul 22, 2020
Other: The `Editor`, `CommandCollection` and `MultiCommand`'s `execute()` method will the result of the called `command.execute()`. Closes #7647.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:dx This issue reports a developer experience problem or possible improvement. package:core type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant