Skip to content

Commit

Permalink
Fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
lmammino committed Nov 19, 2017
1 parent 4734a3f commit a189c05
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ If no middleware manages the error, the lambda execution fails reporting the unm
Middy supports middlewares that return promises instead that directly calling the callback:

```javascript
const asyncValiator = () => {
const asyncValidator = () => {
before: (handler) => {
if (handler.event.body) {
return new Promise((resolve, reject) => {
Expand All @@ -272,7 +272,7 @@ handler.use(asyncValidator)
Thanks to this behaviour you can define middlewares using `async` functions:

```javascript
const asyncValiator = () => {
const asyncValidator = () => {
before: async (handler) => {
if (handler.event.body) {
return await asyncValidate(handler.event.body)
Expand Down
4 changes: 2 additions & 2 deletions README.md.hb
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ If no middleware manages the error, the lambda execution fails reporting the unm
Middy supports middlewares that return promises instead that directly calling the callback:
```javascript
const asyncValiator = () => {
const asyncValidator = () => {
before: (handler) => {
if (handler.event.body) {
return new Promise((resolve, reject) => {
Expand All @@ -272,7 +272,7 @@ handler.use(asyncValidator)
Thanks to this behaviour you can define middlewares using `async` functions:
```javascript
const asyncValiator = () => {
const asyncValidator = () => {
before: async (handler) => {
if (handler.event.body) {
return await asyncValidate(handler.event.body)
Expand Down
1 change: 0 additions & 1 deletion src/middy.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ const runErrorMiddlewares = (middlewares, instance, done) => {
const nextMiddleware = stack.shift()

if (nextMiddleware) {
// return nextMiddleware(instance, runNext)
const retVal = nextMiddleware(instance, runNext)

if (retVal) {
Expand Down

0 comments on commit a189c05

Please sign in to comment.