Skip to content

Commit

Permalink
#update
Browse files Browse the repository at this point in the history
  • Loading branch information
mattstyles committed Mar 29, 2016
1 parent 16ed664 commit 2d1bad8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Middleware can be added in much the same way as it can be added to any regular k
### Example with *async* functions (transpilation required)

```js
io.use( async ( ctx, next ) {
io.use( async ( ctx, next ) => {
let start = new Date()
await next()
console.log( `response time: ${ new Date() - start }ms` )
Expand Down Expand Up @@ -155,12 +155,12 @@ As the context is passed to each function in the response chain it is fair game


```js
io.use( async ( ctx, next ) {
io.use( async ( ctx, next ) => {
ctx.process = process.pid
await next()
})

io.use( async ( ctx, next ) {
io.use( async ( ctx, next ) => {
// ctx is passed along so ctx.process is now available
console.log( ctx.process )
})
Expand Down

0 comments on commit 2d1bad8

Please sign in to comment.