From 87cde82399fff84a1628bbb37eb379f8e3306921 Mon Sep 17 00:00:00 2001 From: Chiahao Lin Date: Fri, 7 Jul 2017 15:48:31 +0800 Subject: [PATCH] docs: modified examples using the wrong keyword (yield -> await) (#1021) --- docs/api/request.md | 2 +- docs/api/response.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/request.md b/docs/api/request.md index 4738fbe..837fe3d 100644 --- a/docs/api/request.md +++ b/docs/api/request.md @@ -167,7 +167,7 @@ if (ctx.fresh) { // cache is stale // fetch new data -ctx.body = yield db.find('something'); +ctx.body = await db.find('something'); ``` ### request.stale diff --git a/docs/api/response.md b/docs/api/response.md index f66aa23..e224c7d 100644 --- a/docs/api/response.md +++ b/docs/api/response.md @@ -234,7 +234,7 @@ ctx.type = 'png'; const minify = require('html-minifier'); app.use(function * minifyHTML(next) { - yield next; + await next; if (!ctx.response.is('html')) return;