Chapter 13Project: An End to Callback Hell

One of the knocks on many large JavaScript codebases is the inevitable tangle of callbacks scattered throughout. There is definite power in keeping execution frames small. We need look no further than the rise of Node.js for evidence to support this. But even the most experienced JavaScripters can be confused by the interplay of a myriad of callbacks and events.

So far, our Hipster MVC library exhibits many of the same characteristics of the JavaScript approach—and we have yet to even attempt error handling! As you saw in Chapter 8, Events and Streams, the syntax for Dart events is different from that of JavaScript, but the approach is very much the same. This is not the case with callbacks. Let’s ...

Get Dart 1 for Everyone now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.