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

Support for async/await #50

Closed
lmammino opened this issue Nov 18, 2017 · 1 comment
Closed

Support for async/await #50

lmammino opened this issue Nov 18, 2017 · 1 comment

Comments

@lmammino
Copy link
Member

Coming out from a discussion in #49, it might be very useful to support async functions as middlewares.

The idea is that we might support middlewares with the following syntax:

export default function() {
  return {
    before: async (handler) => {
       // await async stuff
       return 'somevalue'  // equivalent to calling next(null, 'somevalue')
    }
  };
}
@lmammino
Copy link
Member Author

Closed by #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant