-
Notifications
You must be signed in to change notification settings - Fork 2
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
node8, const, async #17
base: master
Are you sure you want to change the base?
Conversation
src/index.js
Outdated
@@ -78,21 +63,21 @@ function deleteStacks(stacks, dryRun) { | |||
}); | |||
} | |||
|
|||
function listAllStacksWrapper() { | |||
const listAllStacksWrapper = 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.
If we are not awaiting anything in this block then we can ditch the Async keyword
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.
that was awaited in line 14, but i've removed the intermediate listAllStacksWrapper that isn't needed now
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.
Unless you are awaiting within the code block you don't need the async keyword. You can still use await on line 14 since promises are awaitable
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 is now awaiting on the cloudformation api call in https://github.com/nib-health-funds/cfn-batman/pull/17/files#diff-1fdf421c05c1140f6d71444ea2b27638R69
src/index.js
Outdated
return new Promise((resolve, reject) => { | ||
return listAllStacks(null, [], resolve, reject); | ||
}); | ||
} | ||
|
||
function listAllStacks(token, stackArray, resolve, reject) { | ||
const listAllStacks = async (token, stackArray, resolve, reject) => { |
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.
Same as above
No description provided.