Comparing version 0.0.3 to 0.0.4
{ | ||
"name":"qi", | ||
"description":"Wait to call the final callback until all subtasks have returned.", | ||
"version":"0.0.3", | ||
"version":"0.0.4", | ||
"homepage":"http://github.com/TorchlightSoftware/qi", | ||
@@ -6,0 +6,0 @@ "repository":"git://github.com/TorchlightSoftware/qi.git", |
@@ -5,3 +5,3 @@ # Qi | ||
It is simpler and smaller than any other flow control library you will find, and the features are very powerful. | ||
It is simpler and smaller than any other flow control library you will find, and the features are so powerful, it's probably a monad. | ||
@@ -56,2 +56,21 @@ It supports three operations: | ||
### Example | ||
```coffee-script | ||
should = require 'should' | ||
{disperse} = require 'qi' | ||
describe 'disperse', -> | ||
it 'should call all callbacks', -> | ||
yin = (input) -> | ||
input.should.eql 1 | ||
yang = (input) -> | ||
input.should.eql 1 | ||
taiji = disperse yin, yang | ||
taiji 1 | ||
``` | ||
## Channel | ||
@@ -61,2 +80,28 @@ | ||
### Example | ||
```coffee-script | ||
should = require 'should' | ||
{channel} = require 'qi' | ||
describe 'channel', -> | ||
it 'should call multiple functions', (done) -> | ||
task1 = (arg, next) -> | ||
next null, arg * 4 | ||
task2 = (arg, next) -> | ||
next null, arg + 2 | ||
final = (err, arg) -> | ||
should.not.exist err | ||
should.exist arg | ||
arg.should.eql 42 | ||
done() | ||
sequence = channel(task1, task2) | ||
sequence 10, final | ||
``` | ||
## LICENSE | ||
@@ -63,0 +108,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
9289
128