Skip to content

Commit

Permalink
update test;
Browse files Browse the repository at this point in the history
  • Loading branch information
switer committed Dec 27, 2013
1 parent df2646e commit c272d2e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ Chain(function (chain, msg) {
chain.data('chain:param', msg);

console.log(msg); //Hello world
setTimeout( function() {
// setTimeout( function() {
chain.next({message: 'Next step'});
}, 3000);
// }, 3000);

}, 'Hello world')
.then(function (chain, param) {
console.log('Chain step 1');
// chain.stop();
console.log(param.message); // Next step
chain.next({name: 'switer'});
return;
console.log(param.message); // log: Next step
})
.then(function (chain, param) {
console.log('Chain step 2');
Expand All @@ -36,8 +37,10 @@ Chain(function (chain, msg) {
})
.filter(function (filter, param) {
console.log('filter 1', param);
// the param will be no to next filter
filter.next({'abc':1123});
setTimeout( function() {
filter.next({'abc':1123});
}, 2000);

})
.filter(function (filter, param) {
console.log('filter 2', param);
Expand Down

0 comments on commit c272d2e

Please sign in to comment.