Skip to content

Commit

Permalink
Break things up with dependency of inversion
Browse files Browse the repository at this point in the history
  • Loading branch information
beautifulcoder committed Aug 6, 2016
1 parent 8f02695 commit 59017f3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions callbackDependencyInversion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
setTimeout(getPanther, 1, 'Panther');

var catList = '';

function getPanther(name) {
catList = name + ',';

setTimeout(getJaguar, 1, 'Jaguar');
}

function getJaguar(name) {
catList += name + ',';

setTimeout(getLynx, 1, 'Lynx');
}

function getLynx(name) {
catList += name + ',';

setTimeout(getSnowLeopard, 1, 'Snow Leopard');
}

function getSnowLeopard(name) {
catList += name + ',';

setTimeout(getLion, 1, 'Lion');
}

function getLion(name) {
catList += name;

console.log(catList);
}

0 comments on commit 59017f3

Please sign in to comment.