From be30a396f2a34455c06d0317ee1b43839cf9a9c4 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 8 Nov 2016 05:11:02 +0300 Subject: [PATCH] fix: now inner fully supports the action protocol (returning a function -> post-handler) in .chain*(..)... Signed-off-by: Alex A. Naanou --- actions.js | 7 ++++++- package.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/actions.js b/actions.js index 1a40edb..1a64dca 100755 --- a/actions.js +++ b/actions.js @@ -538,8 +538,13 @@ Action.prototype.chainApply = function(context, inner, args){ context[inner].chainApply(context, null, args) : 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... - if(res !== undefined){ + } else if(res !== undefined){ data.result = res } } diff --git a/package.json b/package.json index bcae4c2..63af4db 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-actions", - "version": "1.7.0", + "version": "1.7.1", "description": "", "main": "actions.js", "scripts": {