Skip to content

Commit a7cd307

Browse files
committed
support router.wrapAsync
1 parent 04f432a commit a7cd307

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yog2-kernel",
3-
"version": "1.3.3",
3+
"version": "1.4.0",
44
"description": "yog2 kernel",
55
"main": "index.js",
66
"keywords": [

plugins/dispatcher/dispatcher.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ module.exports = function (options) {
247247
router.action = function (actionName) {
248248
return getAction(routerName, actionName);
249249
};
250+
// support wrap raw async fn
251+
router.wrapAsync = function (fn) {
252+
return wrapAsyncFunction(fn, true);
253+
};
250254
// load user defined router
251255
var customRouter = require(routerPath);
252256
// typescript compliant

0 commit comments

Comments
 (0)