Open atticoos opened 9 years ago
I hate callback structures. I'm already creating callback trees like
device.connect(function () { device.startApplication(function () { device.sendMessage('yo'); }, function (error) { // start app error }); }, function (error) { // connect error });
I would love to see:
device.connect().then(function () { return device.startApplication(); }).then(function () { return device.sendMessage('yo'); }).catch(function (error) { // error handler });
It is easy: you write a wrapper with org.favo.promise to realize this.
I hate callback structures. I'm already creating callback trees like
I would love to see: