fix: Allow synchronous handlers#1159
Conversation
The current type of `LambdaWrapper#wrap` requires handlers to return a `Promise`. We should support synchronous handlers too. No implementation change is required – they're already supported, just disallowed by the type system. Jira: [ENG-2732]
|
Sorry about this but can I ask a stupid question, as I don't feel that comfortable with Typescript generics. The intention here is to allow the function to return a Type or a Promise that returns a Type. Why isn't |
It's akin to "normal" function parameters: you declare your function TS docs: https://www.typescriptlang.org/docs/handbook/2/generics.html |
|
🎉 This PR is included in version 2.0.0-beta.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The current type of
LambdaWrapper#wraprequires handlers to return aPromise. We should support synchronous handlers too.No implementation change is required – they're already supported, just disallowed by the type system.
Jira: ENG-2732