3 ms·
And here's how to do the same in plain CoffeeScript with generators — using a new patch landed a couple of minutes ago: https://github.com/jashkenas/coffeescrip
by jashkenas 12y ago
And here's how to do the same in plain CoffeeScript with generators — using a new patch landed a couple of minutes ago: https://github.com/jashkenas/coffeescript/pull/3240/files https://github.com/jashkenas/coffeescript/pull/3240/files
->
try
body = yield request "https://x.io/"
yield request "https://x.io/?q=#{body.hash}"
catch e
# do what you like with the error
... the salient bit being that there's no need to declare a generator function as a "special" type of function different from any other — a generator is simply a function that yields.