Comparing version 0.8.0 to 0.9.0
@@ -64,3 +64,2 @@ // jWorkflow.js | ||
_self = { | ||
andThen: function (func, context) { | ||
@@ -72,3 +71,5 @@ if (_isWorkflow(func)) { | ||
callback: function (result) { | ||
baton.pass(result); | ||
setTimeout(function() { | ||
baton.pass(result); | ||
}, 1); | ||
}, | ||
@@ -87,3 +88,6 @@ context: context, | ||
join = function () { | ||
return --l || baton.pass(); | ||
return --l || | ||
setTimeout(function() { | ||
baton.pass(); | ||
}, 1); | ||
}; | ||
@@ -90,0 +94,0 @@ |
{ | ||
"name": "jWorkflow", | ||
"version" : "0.8.0", | ||
"version" : "0.9.0", | ||
"description" : "dude, wheres my workflow?", | ||
"homepage": "https://github.com/tinyhippos/jWorkflow", | ||
"homepage": "https://github.com/gtanner/jWorkflow", | ||
"author": "gtanner", | ||
@@ -11,2 +11,6 @@ "contributors": [{ | ||
"url": "http://github.com/gtanner" | ||
}, { | ||
"name": "CatTail", | ||
"email": "zhongchiyu@gmail.com", | ||
"url": "http://github.com/CatTail" | ||
}], | ||
@@ -13,0 +17,0 @@ "licenses": [{ |
@@ -171,1 +171,2 @@ # jWorkflow | ||
Gord Tanner <gtanner@gmail.com> | ||
CatTail <zhongchiyu@gmail.com> |
@@ -521,2 +521,27 @@ $(document).ready(function () { | ||
}); | ||
asyncTest("jWorkflow, we can pass another non-async workflow into andThen", function() { | ||
var count = 0, | ||
inc = function() { count++; }, | ||
order1 = jWorkflow.order(inc), | ||
order2 = jWorkflow.order(order1); | ||
order2.start(inc); | ||
setTimeout(function() { | ||
start(); | ||
equals(count, 2, "expect last work only being executed once"); | ||
}, 2); | ||
}); | ||
asyncTest("jWorkflow, we can pass an array of non-async functions into andThen", function() { | ||
var count = 0, | ||
inc = function() { count++; }, | ||
order = jWorkflow.order([inc, inc]); | ||
order.start(inc); | ||
setTimeout(function() { | ||
start(); | ||
equals(count, 3, "expect last work only being executed once"); | ||
}, 2); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
115544
1666
172