Slide 9
Slide 9 text
State Machines & node.js
Be gone evil callbacks...
doSomething(param, function (err, data) {
if (err) {...}
doSomethingElse(data, anotherParam, function (err2, info) {
if (err2) {...}
if (info.isComplex) {
furtherCall(data, info, function (err3, furtherInfo) {
...
}) ;
} else {
furtherCall2(info, function (err3, furtherInfo) {
...
}) ;