From a7cd307f752f9afe68822e34e5ad452f4541d5d9 Mon Sep 17 00:00:00 2001 From: hefangshi Date: Tue, 16 Aug 2016 18:26:54 +0800 Subject: [PATCH] support router.wrapAsync --- package.json | 2 +- plugins/dispatcher/dispatcher.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 428a13c..d412b88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yog2-kernel", - "version": "1.3.3", + "version": "1.4.0", "description": "yog2 kernel", "main": "index.js", "keywords": [ diff --git a/plugins/dispatcher/dispatcher.js b/plugins/dispatcher/dispatcher.js index b9fc47c..608e219 100644 --- a/plugins/dispatcher/dispatcher.js +++ b/plugins/dispatcher/dispatcher.js @@ -247,6 +247,10 @@ module.exports = function (options) { router.action = function (actionName) { return getAction(routerName, actionName); }; + // support wrap raw async fn + router.wrapAsync = function (fn) { + return wrapAsyncFunction(fn, true); + }; // load user defined router var customRouter = require(routerPath); // typescript compliant