Comparing version 0.14.1 to 0.14.2
@@ -7,2 +7,4 @@ "use strict"; | ||
exports.default = A; | ||
/* eslint-disable max-len */ | ||
function A() { | ||
@@ -19,3 +21,3 @@ return this.scope; | ||
if (!scope.hasOwnProperty(props.result)) { | ||
throw new Error("You are trying to return \"" + props.result + "\" as a result of an <A> element. However no one is exporting it."); | ||
throw new Error("You are trying to return \"" + props.result + "\" as a result of an <A> element. However no one down the chain is exporting it."); | ||
} | ||
@@ -22,0 +24,0 @@ context.result = scope[props.result]; |
@@ -16,5 +16,3 @@ 'use strict'; | ||
type = _ref.type; | ||
var exports = this.props.exports; | ||
if (type) { | ||
@@ -21,0 +19,0 @@ _Integration2.default.addListener(function (action) { |
@@ -16,5 +16,3 @@ 'use strict'; | ||
type = _ref.type; | ||
var exports = this.props.exports; | ||
if (type) { | ||
@@ -21,0 +19,0 @@ var removeListener = _Integration2.default.addListener(function (action) { |
@@ -14,8 +14,6 @@ 'use strict'; | ||
var _Element = require('./Element'); | ||
var _Element = require('./elements/Element'); | ||
var _Element2 = _interopRequireDefault(_Element); | ||
var _utils = require('./utils'); | ||
var _A = require('./elements/A'); | ||
@@ -29,2 +27,4 @@ | ||
var _utils = require('./utils'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -39,3 +39,3 @@ | ||
return func === create ? (0, _Element2.default)(_A2.default, _extends({}, props, { scope: '*' }), children) : (0, _Element2.default)(func, props, children); | ||
return func === create ? (0, _Element2.default)(_A2.default, _extends({ scope: '*' }, props), children) : (0, _Element2.default)(func, props, children); | ||
} | ||
@@ -42,0 +42,0 @@ |
@@ -6,14 +6,59 @@ 'use strict'; | ||
}); | ||
exports.flow = flow; | ||
/* eslint-disable max-len */ | ||
var ids = 100; | ||
var getId = exports.getId = function getId() { | ||
return ids++; | ||
}; | ||
var isItAnElement = exports.isItAnElement = function isItAnElement(element) { | ||
return element && element.__actml; | ||
}; | ||
var getFuncName = exports.getFuncName = function getFuncName(func) { | ||
var result = /function\*?\s+([\w\$]+)\s*\(/.exec(func.toString()); | ||
return result ? result[1] : 'unknown'; | ||
}; | ||
function flow() { | ||
var api = { | ||
context: {}, | ||
errorHandler: function errorHandler(error) { | ||
throw error; | ||
}, | ||
doneFunc: function doneFunc() {}, | ||
withContext: function withContext(c) { | ||
this.context = c; | ||
return this; | ||
}, | ||
done: function done(d) { | ||
this.doneFunc = d; | ||
return this; | ||
}, | ||
withErrorHandler: function withErrorHandler(e) { | ||
this.errorHandler = e; | ||
return this; | ||
}, | ||
run: function run(workers) { | ||
var _this = this; | ||
var isItAnElement = exports.isItAnElement = function isItAnElement(element) { | ||
return element && element.__actml; | ||
}; | ||
if (workers.length === 0) { | ||
this.doneFunc(); | ||
} else { | ||
try { | ||
var worker = workers.shift(); | ||
var ids = 100; | ||
var getId = exports.getId = function getId() { | ||
return ids++; | ||
}; | ||
worker(this.context, function () { | ||
return flow().withContext(_this.context).done(_this.doneFunc).run(workers); | ||
}); | ||
} catch (error) { | ||
this.errorHandler(error, function () { | ||
return flow().withContext(_this.context).done(_this.doneFunc).run(workers); | ||
}); | ||
} | ||
} | ||
} | ||
}; | ||
return api; | ||
} |
{ | ||
"name": "actml", | ||
"version": "0.14.1", | ||
"version": "0.14.2", | ||
"description": "Like jsx but for your business logic", | ||
@@ -28,10 +28,13 @@ "main": "lib", | ||
"devDependencies": { | ||
"babel-cli": "6.26.0", | ||
"babel-core": "6.26.3", | ||
"babel-cli": "6.26.0", | ||
"babel-eslint": "8.0.3", | ||
"babel-jest": "23.4.2", | ||
"babel-plugin-transform-object-rest-spread": "6.26.0", | ||
"babel-preset-es2015": "6.24.1", | ||
"babel-preset-react": "6.24.1", | ||
"babel-plugin-transform-object-rest-spread": "6.26.0", | ||
"babelify": "8.0.0", | ||
"browserify": "14.5.0", | ||
"eslint": "4.12.1", | ||
"eslint-plugin-react": "7.5.1", | ||
"fsevents": "1.2.4", | ||
@@ -38,0 +41,0 @@ "jest": "23.5.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
417713
33
894
16