Cleaner CoffeeScript Callbacks

gga

Building a Calatrava app means writing a lot of
CoffeeScript. Here’s a small tip to make that CoffeeScript read even
better than it already does. When you’re writing a function that takes
a callback as an argument, try passing the callback a little differently.

Though I’ve never written any SmallTalk, I believe this is inspired by
that language. Effectively what you’re doing is defining a new control
flow construct, so name it as such. The call to radar.repository.get
now reads as a statement of the intent for all outcomes.

It’s a small thing, but it does feel much clearer.

Oh, and thanks to CoffeeScript’s object destructuring syntax, prefer a
single options hash over parameter lists.