Refactor application.js - use arrow function in callback

This commit is contained in:
Slobodan Stojanovic 2015-10-24 16:19:56 +02:00
parent 863fce310b
commit 0df400fa60

View file

@ -115,9 +115,7 @@ module.exports = class Application extends Emitter {
res.statusCode = 404; res.statusCode = 404;
const ctx = this.createContext(req, res); const ctx = this.createContext(req, res);
onFinished(res, ctx.onerror); onFinished(res, ctx.onerror);
fn(ctx).then(function() { fn(ctx).then(() => respond(ctx)).catch(ctx.onerror);
respond(ctx);
}).catch(ctx.onerror);
}; };
} }