From 07d6b62cad891ce2a51a60f81a6af00b73f3b9fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 22 Apr 2014 12:33:55 +0200 Subject: [PATCH 1/1] fnpjs: actions - action returns via callback This allows asynchronous action execution --- src/fnpjs/actions.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fnpjs/actions.js b/src/fnpjs/actions.js index c49373a..f380ed6 100644 --- a/src/fnpjs/actions.js +++ b/src/fnpjs/actions.js @@ -72,10 +72,11 @@ _.extend(Action.prototype, Backbone.Events, { } return this._cache; }, - execute: function() { + execute: function(callback) { var state = this.getState(); + callback = callback || function() {}; if(state.allowed) { - return state.execute.call(this, this.params, this.appObject); + return state.execute.call(this, callback, this.params, this.appObject); } throw new Error('Execution not allowed'); } -- 2.20.1