fix: now inner fully supports the action protocol (returning a function -> post-handler) in .chain*(..)...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-11-08 05:11:02 +03:00
parent b9e5d34254
commit be30a396f2
2 changed files with 7 additions and 2 deletions

View File

@ -538,8 +538,13 @@ Action.prototype.chainApply = function(context, inner, args){
context[inner].chainApply(context, null, args) context[inner].chainApply(context, null, args)
: undefined : undefined
// call the resulting function...
if(res instanceof Function){
res.apply(context, [context].concat(args))
data.result = context
// push the inner result into the chian... // push the inner result into the chian...
if(res !== undefined){ } else if(res !== undefined){
data.result = res data.result = res
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-actions", "name": "ig-actions",
"version": "1.7.0", "version": "1.7.1",
"description": "", "description": "",
"main": "actions.js", "main": "actions.js",
"scripts": { "scripts": {