Comparing version 1.0.2 to 1.0.3
@@ -15,10 +15,12 @@ 'use strict'; | ||
tasks[key](function(out) { | ||
if (out instanceof Error) { | ||
errors.push(key); | ||
if (counter < limit) { | ||
if (out instanceof Error) { | ||
errors.push(key); | ||
} | ||
results[key] = out; | ||
counter++; | ||
if(counter === limit) { | ||
fn(results, errors); | ||
} | ||
} | ||
results[key] = out; | ||
counter++; | ||
if(counter >= limit) { | ||
fn(results, errors); | ||
} | ||
} | ||
@@ -25,0 +27,0 @@ ); |
{ | ||
"name": "datamodel", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"author": "Nicolas Thouvenin <nthouvenin@gmail.com>", | ||
@@ -5,0 +5,0 @@ "contributors": [], |
# Datamodel | ||
[![Build Status](https://secure.travis-ci.org/touv/node-datamodel.png?branch=master)](http://travis-ci.org/touv/node-datamodel) | ||
Design datamodels with asynchronous functions and flows. | ||
@@ -123,10 +125,10 @@ | ||
## datamodel() | ||
## declare(String key, Function callback) | ||
## append(String key, Function callback) | ||
## complete(String key, Function callback) | ||
## transform(Function callback) | ||
## send(Function callback) | ||
## apply(Mixed input, Function callback) | ||
## attach(Object module) | ||
### datamodel() | ||
### declare(String key, Function callback) | ||
### append(String key, Function callback) | ||
### complete(String key, Function callback) | ||
### transform(Function callback) | ||
### send(Function callback) | ||
### apply(Mixed input, Mixed output, Function callback) | ||
### attach(Object module) | ||
@@ -133,0 +135,0 @@ # License |
@@ -230,5 +230,25 @@ /* global describe, it */ | ||
it('13 - muticall', function (done) { | ||
var m = datamodel() | ||
.declare('a', function(input, fill) { | ||
fill('(a)'); | ||
fill('(b)'); | ||
}); | ||
m.apply(function(err, res1) { | ||
assert.equal(res1.a, '(a)'); | ||
m.apply(function(err, res2) { | ||
assert.equal(res2.a, '(a)'); | ||
done(); | ||
} | ||
); | ||
} | ||
); | ||
} | ||
); | ||
/* */ | ||
} | ||
) |
17200
11
441
139