Refactor application.js - use arrow function in callback
This commit is contained in:
parent
863fce310b
commit
0df400fa60
1 changed files with 1 additions and 3 deletions
|
@ -115,9 +115,7 @@ module.exports = class Application extends Emitter {
|
|||
res.statusCode = 404;
|
||||
const ctx = this.createContext(req, res);
|
||||
onFinished(res, ctx.onerror);
|
||||
fn(ctx).then(function() {
|
||||
respond(ctx);
|
||||
}).catch(ctx.onerror);
|
||||
fn(ctx).then(() => respond(ctx)).catch(ctx.onerror);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue