Tagged Questions
10
votes
2answers
131 views
Pledge: Promise-like entities design goals experiment
Background
I was writing a promises/a+ implementation, just for fun. About halfway through I decided it wasn't that fun after all, so I decided to do something a little different.
Thinking of ...
7
votes
1answer
115 views
Requesting Resources Until Exhaustion
When an API has a 'next' feature, I use the following pattern to obtain all the results:
...
6
votes
2answers
77 views
Is this the right way to work with callbacks and the EventEmitter?
I'm creating a small online multiplayer game in NodeJS and I'm wondering if I'm "doing it right".
Here is a bit of my code:
...
3
votes
2answers
250 views
Passing Context in CoffeeScript
I'm trying to migrate from JavaScript to CoffeeScript. However I'm not sure about the best way to optimize the code generated by js2coffee.
Below is the original JavaScript source :
...
3
votes
1answer
669 views
Node.js Async Callback Hell
Attempting to create a final array with data pulled from 3 functions. The first two functions have all the data but then the 3rd function needs to run looping through one of the fields from function 2 ...
3
votes
1answer
54 views
Using jquery Callbacks.fire method as a event handler
So I've got a jquery project where I'm using an external class that has callback style events. Meaning, it has an "onSave" property that takes one function. However, I need to more than one other ...
1
vote
1answer
561 views
Calling a function when all asynchronous calls complete
Below is a simplified version of some code I am using to execute a function after all asynchronous calls complete. Is this a reasonable piece of code? It seems to work. Nothing would break if ...
1
vote
1answer
523 views
Node.js DynamoDB callback
I am writing an API which gets results from a DynamoDB table and puts the JSON back into the browser.
The code below works and returns the desired results. However, after reading about async and ...
1
vote
1answer
41 views
Can this code utilizing promises be written more succinctly?
I've written the following code to get all .txt files in a directory and read+delete them, repeating every 15 seconds.
...
1
vote
0answers
44 views
JavaScript parameters - best practices for settings object/callback
I have the following function which runs as expected and is defined in the window object:
...
1
vote
0answers
767 views
Javascript Queue for async functions
Based on the answer to my previous question on Stack Overflow, I put together the following Queue class. I realize there are already libraries out there to do this. However, I wanted to actually ...
0
votes
0answers
52 views
My yld NPM - callbacks/promises alternative
I'd like feedback on my callbacks/promises alternative, please.
The yld repository
...