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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for async await in handler #59

Merged
merged 5 commits into from Dec 15, 2017

Conversation

lmammino
Copy link
Member

@lmammino lmammino commented Dec 15, 2017

Closes #52

TODO:

  • Add docs and examples
  • Update typings for typescript
  • Version bump

READY FOR REVIEW 馃

@codecov
Copy link

codecov bot commented Dec 15, 2017

Codecov Report

Merging #59 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #59   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          10     10           
  Lines         157    165    +8     
  Branches       36     37    +1     
=====================================
+ Hits          157    165    +8
Impacted Files Coverage 螖
src/middy.js 100% <100%> (酶) 猬嗭笍

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 2722b10...d8e25f9. Read the comment docs.

@lmammino
Copy link
Member Author

@joseSantacruz can you please verify if the typescript changes here make sense?

@lmammino lmammino changed the title [WIP] Added support for async await in handler Added support for async await in handler Dec 15, 2017
Copy link
Contributor

@peterjcaulfield peterjcaulfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. GJ. Just a couple of teeny things.

README.md Outdated
})
```

We believe that the async/await version is easier to read and reason about.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is redundant based on sentence above I think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

})
})

test('An handler that returns a non-promise should trigger an error', (endTest) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo. s/An handler/A handler

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

})
})

test('An handler that returns a non-promise should trigger an error', (endTest) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about handling then-able objects?

@lmammino lmammino merged commit 7cbd7a8 into master Dec 15, 2017
@lmammino lmammino deleted the feature/async-await-handler branch December 15, 2017 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants