Comparing version 3.1.0 to 3.1.1
{ | ||
"name": "kgo", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Flow control the super easy way", | ||
@@ -5,0 +5,0 @@ "main": "kgo.js", |
@@ -92,3 +92,3 @@ kgo | ||
You will often not need the result of a dependency, and it's annoying to have unused parameters in your functions. | ||
You can specify that you have a dependancy, whos result you don't want, by prefixing the dependancy name with an exclamation mark: | ||
You can specify that you have a dependency, whos result you don't want, by prefixing the dependency name with an exclamation mark: | ||
@@ -162,2 +162,15 @@ ``` javascript | ||
## kgo.sync | ||
Sometimes you want to just run a synchonous function as a step in kgo, to do this you can use `kgo.sync`, which will return a callback-passing-style version. | ||
``` javascript | ||
kgo | ||
('task1', task1); | ||
('task2', ['task1'], kgo.sync(function(x){ return x + 1 })) | ||
('task3', ['task2'], task3); | ||
``` | ||
## Errors | ||
@@ -167,2 +180,3 @@ | ||
any task that has a dependency on any error task will resolve if any error dependency is resolved. | ||
@@ -184,3 +198,3 @@ ``` javascript | ||
there is an implicit taskName, `*error`, that will resolve any task that depends on it, even if it has other unresolved dependencies. | ||
there is an implicit error task, `*`, that will resolve to the first of any error that occurs. | ||
@@ -191,3 +205,3 @@ ``` javascript | ||
(another task) | ||
(['*error'], function(error){ | ||
(['*'], function(error){ | ||
// Called if any error occurs in any task | ||
@@ -206,5 +220,5 @@ }); | ||
('result', ['task1', 'task2'], ...) | ||
(['*error', 'result'], callback); // Will be called either if any task errors, OR if result resolves. | ||
(['*', 'result'], callback); // Will be called either if any task errors, OR if result resolves. | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23694
218