Comparing version 0.2.0 to 0.2.1
@@ -99,3 +99,3 @@ (function() { | ||
module.exports = function(obj, options) { | ||
var action, actionName, actions, def, i, j, k, len, name, names, position, ref, results, spread, tmp, v; | ||
var _actions, action, actionName, actions, def, i, j, k, len, name, names, position, ref, results, spread, tmp, v; | ||
if (options != null) { | ||
@@ -144,2 +144,14 @@ if (isString(options) || isArray(options)) { | ||
obj[names.position] = position; | ||
_actions = []; | ||
obj[names.reset + "AllActions"] = (function(_this) { | ||
return function() { | ||
var _action, l, len1, results; | ||
results = []; | ||
for (l = 0, len1 = _actions.length; l < len1; l++) { | ||
_action = _actions[l]; | ||
results.push(_action._chain = []); | ||
} | ||
return results; | ||
}; | ||
})(this); | ||
actions = options.actions; | ||
@@ -169,3 +181,3 @@ if (isString(actions)) { | ||
actionName = k ? k + "." + action : action; | ||
results1.push(tmp[action] = setupAction(actionName, obj, options)); | ||
results1.push(_actions.push(tmp[action] = setupAction(actionName, obj, options))); | ||
} | ||
@@ -172,0 +184,0 @@ return results1; |
{ | ||
"name": "hook-up", | ||
"description": "Create your own hook api with 2-dimensional hooks - better than events or simple hooks", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/paulpflug/", | ||
@@ -23,7 +23,7 @@ "author": { | ||
"devDependencies": { | ||
"chai": "^4.1.2", | ||
"coffee-cli": "^0.2.1", | ||
"coffee-loader": "^0.9.0", | ||
"coffeescript": "^2.2.1", | ||
"coffee-cli": "^0.2.1", | ||
"mocha": "^5.0.0", | ||
"script-runner": "^0.1.7" | ||
"script-runner": "^0.1.7", | ||
"snapy": "^0.1.1" | ||
}, | ||
@@ -35,3 +35,3 @@ "keywords": [], | ||
"build:node": "coffee-cli --no-header --compile --output lib/ src/*.coffee", | ||
"test": "mocha", | ||
"test": "snapy", | ||
"preversion": "npm run test", | ||
@@ -38,0 +38,0 @@ "version": "npm run build && git add .", |
@@ -14,4 +14,2 @@ # hook-up | ||
(please note the absence of object orientated programming - which is *often* increasing complexity without any gain) | ||
## Aim for declarative programming | ||
@@ -51,3 +49,3 @@ | ||
This package is an action builder: | ||
This package is an action builder working in node and in browser (in combination with e.g. webpack) | ||
@@ -107,2 +105,4 @@ | ||
``` | ||
For the separation by functionality design pattern each functionality needs to be a separate plugin (not necessarily a separate package). These plugins need access to the actions of your program. | ||
#### Options | ||
@@ -109,0 +109,0 @@ Name | type | default | description |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
10859
179
0