Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@shesek
Created June 25, 2013 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shesek/5861420 to your computer and use it in GitHub Desktop.
Save shesek/5861420 to your computer and use it in GitHub Desktop.
sequence = (errcb) -> (fn, a..., cb) -> fn a..., (err, b...) -> if err? then errcb err else cb b...
compile = (files, callback) ->
seq = sequence callback
stored <- seq async.sortBy, files, @sort
mapped <- seq async.map, sorted, @map
reduced <- seq async.reduce, mapped, null, @reduce
<- seq @write, reduced
do @log
callback? @getClassName()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment