Is there a way to chain Promises together in Coffeescript. For example, consider the following javascript code,
Promises
return $.getJSON(\'/api/post.json\')
This is probably the best you'll do:
$.getJSON('/api/post.json') .then( (response) -> # do something ).then( (response) -> # do something ).then null, (err) -> # do something
Note the parentheses surrounding the then() arguments. Nothing earth shattering but hopefully this helps.
then()