Skip to content

Commit

Permalink
removed decorator todo, better variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeKittens committed Aug 31, 2015
1 parent 3796676 commit fd21ab4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
16 changes: 6 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var Gustav;
function callSomething(currentDepTree, taskList) {
return taskList.map(function (Task) {
// Build this layer of the dependency tree
var o = {};
var currentDeps = {};
var name = Task.name;
var deps = null;
// TODO: Throw if given a non-Source class with no deps
Expand All @@ -70,14 +70,14 @@ var Gustav;
deps = Task.dependencies();
}
}
o[name] = deps ? [] : null;
var newLen = currentDepTree.push(o);
currentDeps[name] = deps ? [] : null;
var newLen = currentDepTree.push(currentDeps);
// If we've already created this Node, don't instantiate another
// TODO: Allow recreation
if (cache[name]) {
return cache[name];
}
var n = new Task();
var node = new Task();
if (deps) {
if (!(deps instanceof Array)) {
deps = [deps];
Expand All @@ -89,10 +89,10 @@ var Gustav;
else {
upstream = rx_1.Observable.merge(upstream);
}
cache[name] = n.run(upstream);
cache[name] = node.run(upstream);
}
else {
cache[name] = n.run();
cache[name] = node.run();
}
return cache[name];
});
Expand All @@ -108,9 +108,5 @@ var Gustav;
outputStream.write(datums);
});
}
// TODO: create annotation that logs output of Node
function an() {
console.log('annotated');
}
})(Gustav || (Gustav = {}));
exports["default"] = Gustav;
17 changes: 6 additions & 11 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module Gustav {
function callSomething(currentDepTree, taskList:Array<any>):any {
return taskList.map((Task) => {
// Build this layer of the dependency tree
let o = {};
let currentDeps = {};
let name = Task.name;
let deps = null;

Expand All @@ -44,16 +44,16 @@ module Gustav {
}
}

o[name] = deps ? [] : null;
let newLen = currentDepTree.push(o);
currentDeps[name] = deps ? [] : null;
let newLen = currentDepTree.push(currentDeps);

// If we've already created this Node, don't instantiate another
// TODO: Allow recreation
if (cache[name]) {
return cache[name];
}

let n = new Task();
let node = new Task();

if (deps) {
if(!(deps instanceof Array)) {
Expand All @@ -65,9 +65,9 @@ module Gustav {
} else {
upstream = Observable.merge(upstream);
}
cache[name] = n.run(upstream);
cache[name] = node.run(upstream);
} else {
cache[name] = n.run();
cache[name] = node.run();
}
return cache[name];
});
Expand All @@ -85,11 +85,6 @@ module Gustav {
outputStream.write(datums);
});
}

// TODO: create annotation that logs output of Node
function an() {
console.log('annotated');
}
}

export default Gustav;

0 comments on commit fd21ab4

Please sign in to comment.