Questions tagged [iced-coffeescript]

IcedCoffeeScript is a superset of CoffeeScript.

IcedCoffeeScript is a superset of that adds support for await and defer keywords which simplify async control flow. The iced interpreter is a drop-in replacement for the standard coffee interpreter; it will interpret almost all existing CoffeeScript programs.

37 questions
14
votes
4 answers

IcedCoffeeScript or jQuery deferred

Recently while working on a Backbone.JS/jQuery/CoffeeScript project, I found myself in a mess of callback and timing issues. I needed to wait for something to complete before proceeding and found myself in a mess of nested callbacks ... which is…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
10
votes
3 answers

Iced coffee script with multiple callbacks

I'm using Iced coffescript with upshot js when I am refreshing multiple data sources. The refresh method has TWo call backs one for success and one for error and I want to wait for each call to make either callback. I can't see how to do this with…
8
votes
2 answers

How to correctly handle errors with IcedCoffeeScript?

It is common practice in node.js to return error message as the first argument to a callback function. There are a number of solutions to this problem in pure JS (Promise, Step, seq, etc), but none of them seem to be integrable with ICS. What would…
Andrew
  • 8,330
  • 11
  • 45
  • 78
5
votes
1 answer

try catch not always works in iced coffee script

I use try catch block in iced coffee script. I call not existent method fake of not existent object a and expect to catch error. db = require '../../call/db.iced' try await db.find "79", defer c, d a.fake() catch error console.log…
Maxim Yefremov
  • 13,671
  • 27
  • 117
  • 166
4
votes
2 answers

How to use IcedCoffeeScript in function with two callbacks?

Let's assume I have such function (in Javascript): function fun(success_cb, error_cb) { var result; try { result = function_that_calculates_result(); success_cb(result); } catch (e) { error_cb(e); } } And I use it…
franza
  • 2,297
  • 25
  • 39
4
votes
2 answers

Writing Mocha tests with IcedCoffeeScript?

I'm trying to run some database queries in a Mocha test but I'm running into some problems. Here's the test (using Mongoose): it.only "should create some objects", (done) -> await models.MyModel1.count defer(err, oldModel1Count) await…
robbrit
  • 17,560
  • 4
  • 48
  • 68
4
votes
1 answer

Adding IcedCoffeeScript keywords to Webstorm Intellisense

I want to add a few IcedCoffeeScript keywords to the CoffeeScript files highlighting, but the edit button is grayed out for the CoffeeScript file type. Is there a way that I could duplicate a file type that's already in the list and add keywords? …
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
3
votes
2 answers

Is iced coffeescript supporting or going to support promises?

As a node.js practitioner, I am actively using coffeescript and functions based on promises. Recently I have found out iced coffeescript, and I wonder whether my approach can go along with "iced await defer" one. So here is my question, is there any…
Overcommit
  • 89
  • 1
  • 5
3
votes
2 answers

How to use in browser a JS file generated from IcedCoffeeScript

When I use vanilla CoffeeScript, I compile a *.coffee files and send resulted *.js to client. To get rid of dependence on the module async.js in client side, I found the IcedCoffeeScript language extension. But when I compiled my code (wich has…
3
votes
1 answer

Nodemon with IcedCoffeeScript

First of all, I install nodemon globally: npm install -g nodemon Then I try to start my apllication using the following command: nodemon app.iced And I get such error: "SyntaxError: Unexpected token ILLEGAL". However, I can run my application…
Dmitriy
  • 683
  • 2
  • 13
  • 26
3
votes
2 answers

why does iced coffeescript give warning: overused deferral when an exception is thrown

what does the "overused deferral" warning mean in iced coffeescript? It seems to happen when I throw an uncaught error in the code. How can I let the error bubble up as I need it be an uncaught error for unit testing. For instance, if my getByName…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
3
votes
1 answer

await...defer in forEach loop

should this code return 12334 or 12433 ? I expect 12334 but it gives 12433... console.log '1' anArray.forEach (info, index, array)-> console.log '2' await model.findOne info, defer(err, doc) console.log '3' console.log '4'
Charles
  • 11,367
  • 10
  • 77
  • 114
2
votes
2 answers

How can I use await/defer to handle passing success and error callbacks?

For instance take the following code: getThing = (thing_id, cb_success, cb_error) -> model.findById thing_id, (error, thing) -> if error || !thing cb_error "error" else cb_success thing And then to call the…
DanH
  • 5,498
  • 4
  • 49
  • 72
2
votes
1 answer

assert.that is. not working in coffee-script

In my iced-coffee-script test I want to check that something is less than expected. The only library I found for this is assertthat: assert = require 'node-assertthat' assert.that (actualSeconds, is.atMost (expectedSeconds)) But my code cannot be…
Maxim Yefremov
  • 13,671
  • 27
  • 117
  • 166
2
votes
2 answers

Coffeescript syntax highlighting in the browser

I am looking to create a really simple in-browser IDE for CoffeeScript. Basically a text box and a submit button, for now. All the code will then be submitted to the server for execution. One thing I did want, is a syntax highlighting in the…
Alexis
  • 23,545
  • 19
  • 104
  • 143
1
2 3