Comparing version 0.1.1 to 0.1.2
@@ -100,8 +100,12 @@ /* | ||
Group.prototype.pass = function () { | ||
for (var i = 0, l = arguments.length; i < l; i++) { | ||
this.args.push(arguments[i]); | ||
} | ||
}; | ||
// Simple utility for passing a sync value to the next step. | ||
Group.prototype.slot = function () { | ||
if (arguments.length > 0) { | ||
for (var i = 0, l = arguments.length; i < l; i++) { | ||
this.args.push(arguments[i]); | ||
} | ||
this.pass.apply(this, slice.call(arguments)); | ||
} else { | ||
@@ -108,0 +112,0 @@ return this.slotMulti(1); |
{ | ||
"name": "ff", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Concise, Powerful Asynchronous Flow Control in JavaScript", | ||
@@ -5,0 +5,0 @@ "engine": [ "node >=0.2.0" ], |
@@ -9,7 +9,7 @@ if (typeof module !== "undefined") { | ||
describe("#slot() as pass", function () { | ||
describe("#pass()", function () { | ||
it("should pass a reference to the next step", function (done) { | ||
var f = ff(function () { | ||
var foo = { bar: false }; | ||
f.slot(foo); | ||
f.pass(foo); | ||
foo.bar = true; | ||
@@ -23,3 +23,3 @@ }, function (foo) { | ||
describe("#slot() as callback", function () { | ||
describe("#slot()", function () { | ||
it("should pass values to the next function in slotted order", function (done) { | ||
@@ -26,0 +26,0 @@ var f = ff(function () { |
33761
710