Open askucher opened 9 years ago
async-each = (func, arr) --> items = arr.slice! go = -> item = items.splice(0, 1).0 if item? func item, go go!
example
[1,2,3] |> async-each (number,done)-> find-user id: number, (err, user)-> if user? and confirm 'Are you sure?' delete-user number, -> done!
Sounds approximately like async.js::each |> flip |> curry.
each
|>
flip
curry
I think async functions are out of scope for prelude-ls. Maybe it's time for a prelude-ls-async library?
example