Skip to content
Browse files

Remove `.wait()`

  • Loading branch information...
1 parent 18787ea commit a624508a2f72beceec69217184508cbdf1754fdf @hokaccha committed Mar 17, 2012
Showing with 0 additions and 68 deletions.
  1. +0 −33 lib/chain-tiny.js
  2. +0 −35 test/wait.js
View
33 lib/chain-tiny.js
@@ -178,27 +178,6 @@ Chain.prototype.parallel = function(obj) {
/**
- * Wait next process during the `time` (ms).
- *
- * @param {time} Int
- * @return {Object} chain
- * @api public
- */
-Chain.prototype.wait = function(time) {
- var self = this;
-
- return self.chain(function() {
- var args = Array.prototype.slice.call(arguments);
- var next = args.pop();
- args.unshift(null);
- setTimeout(function() {
- next.apply(null, args);
- }, time);
- });
-};
-
-
-/**
* Static method for `.each()`.
*
* @param {Object} Object
@@ -238,15 +217,3 @@ Chain.eachParallel = function(obj, fn) {
Chain.parallel = function(ary) {
return Chain().parallel(ary);
};
-
-
-/**
- * Static method for `.wait()`.
- *
- * @param {time} Int
- * @return {Object} chain
- * @api public
- */
-Chain.wait = function(time) {
- return Chain().wait(time);
-};
View
35 test/wait.js
@@ -1,35 +0,0 @@
-var nodeunit = require('nodeunit');
-var chain = require('../index');
-
-module.exports = nodeunit.testCase({
- '.wait()': function(t) {
- var start = Date.now();
- chain(function(next) {
- next(null, 'foo', 'bar');
- })
- .wait(100)
- .chain(function(foo, bar, next) {
- t.equal(foo, 'foo');
- t.equal(bar, 'bar');
- t.ok(Date.now() - start >= 90);
- next();
- })
- .end(function(err) {
- t.equal(err, null);
- t.done();
- });
- },
- 'Chain.wait()': function(t) {
- var start = Date.now();
- chain
- .wait(100)
- .chain(function(next) {
- t.ok(Date.now() - start >= 90);
- next();
- })
- .end(function(err) {
- t.equal(err, null);
- t.done();
- });
- }
-});

0 comments on commit a624508

Please sign in to comment.
Something went wrong with that request. Please try again.