Created
December 28, 2013 17:17
-
-
Save audreyt/8161697 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q = require \q | |
p = [1 2 3] | |
q = [4 5 6] | |
(.reduce Q.when, Q!) <| for let i in p => -> | |
<- Q.delay 500ms .then | |
console.log i | |
(.reduce Q.when, Q!) <| for let j in q => -> | |
<- Q.delay 500ms .then | |
console.log i, j |
{delay}:Q = require \q
p = [1 2 3]
q = [4 5 6]
each = (xs, f) -> xs.map((x) -> -> f x).reduce Q.when, Q!
each p, (i) ->
console.log i
<- delay 500ms .then
each q, (j) ->
console.log i, j
<- delay 500ms .then
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Flattened with helper: