Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove logging. Add .length

  • Loading branch information...
commit c64ac0d0ccfc22280c86b8264a047fba3b48e3d3 1 parent 61a578e
@tim-smart authored
Showing with 7 additions and 3 deletions.
  1. +6 −2 lib/parallel/index.js
  2. +1 −1  package.json
View
8 lib/parallel/index.js
@@ -1,7 +1,8 @@
var Task = exports.Task = function Task(actions) {
- this.actions = {};
+ this.actions = {};
this._emitter = new process.EventEmitter();
+ this.length = 0;
if ('object' === typeof actions) {
var keys = Object.keys(actions);
@@ -14,6 +15,10 @@ var Task = exports.Task = function Task(actions) {
};
Task.prototype.add = function add(name, action) {
+ if (!this.actions[name]) {
+ ++this.length;
+ }
+
this.actions[name] = action;
return this;
@@ -47,7 +52,6 @@ Task.prototype.run = function run(callback) {
args.push(function() {
arguments = Array.prototype.slice.call(arguments);
arguments.unshift(key);
- console.log(arguments);
self._emitter.emit.apply(self._emitter, arguments);
callback.apply(self, arguments);
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "parallel",
"description": "Create tasks in node.js that run in parallel, or sequences that run tasks one after another.",
- "version": "0.1.3",
+ "version": "0.2.0",
"author": "Tim Smart",
"repository": {
"type": "git",
Please sign in to comment.
Something went wrong with that request. Please try again.