-
Notifications
You must be signed in to change notification settings - Fork 3
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
locking/unlocking #3
base: master
Are you sure you want to change the base?
Conversation
Locking and unlocking of topic instances.
Question: should we also have a |
/** | ||
* Check if the current topic is locked. | ||
*/ | ||
public async isLocked(state: mage.core.IState = new mage.core.State()) { |
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.
Not sure about TypeScript, but in ES (afaik) if you return a Promise, you should not mark your function async
.
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.
It doesn't matter: if you return a promise on an async call, then that promise will be the promise to be returned.
tslint
is currently configured to request that functions returning promises or otherwise using await
require the async
keyword. I believe this is for readability purposes (e.g. when checking the function signature), but also to make sure that whatever you return is a promise.
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.
Do you know if that is true for ES as well?
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.
Yes.
Locking and unlocking of topic instances.
cc @ronkorving @AlmirKadric feedback welcome.