Questions tagged [rsvp-promise]

The promise library of the [tag:rsvp.js] suite

52 questions
10
votes
1 answer

How do Promises/A+ implementations vary?

What aspects of a promise library does the spec not cover? What kind of things vary between implementations? Please illustrate with examples of actual differences (eg between Bluebird and Q).
callum
  • 34,206
  • 35
  • 106
  • 163
8
votes
1 answer

How to run a promise-then chain using map or reduce on an arbitrary number of chain elements?

I'm stuck on the following: A script is returning an arbitrary number n or array, like this: [["a"], ["b"], ["c"], ["d"]] I need to loop over the arrays using promise then(), but as I don't know how many elements there will be, I have ended up…
frequent
  • 27,643
  • 59
  • 181
  • 333
8
votes
2 answers

How to return a promise composed of nested models in EmberJS with EmberData?

Enviroment # Ember : 1.4.0 # Ember Data : 1.0.0-beta.7+canary.b45e23ba Model I have simplified my use case to make the question easier to understand and anwser. Let's assume we have 3 models: Country, Region and Area: Country: - id:…
ioleo
  • 4,697
  • 6
  • 48
  • 60
7
votes
1 answer

How to bubble up a rejected promise when using Ember.PromiseProxyMixin

I am using Ember's PromiseProxyMixin with AJAX data calls and Ember RSVP Promises. Rather than incorporating error-handling in each route/template, I would like to bubble a rejected promise up to an error handler in the Application route as…
Jon
  • 191
  • 7
7
votes
1 answer

How to read multiple files asynchronously with promises, then proceed

I'm new to promises and using the rsvp implementation. I want to asynchronously read a list of files, then proceed to another task only when all files have been read. I've got as far as the basic structure to read one file, and chain to the next…
mtmacdonald
  • 14,216
  • 19
  • 63
  • 99
5
votes
3 answers

Node.js - call a method after another method is fully executed

I have 2 simple methods: function do(x,y){ if(x){ XHR1().success(); } if(y){ XHR2().success(); } } function done(){ return something; } now i just would like to be sure to call done() when do() has finished (**do() method…
itsme
  • 48,972
  • 96
  • 224
  • 345
4
votes
2 answers

How can I stub a Promise such that my test can be run synchronously?

I am trying to unit test a module by stubbing one of its dependencies, in this case the UserManager A simplified version of the module is as follows: // CodeHandler module.exports = function(UserManager) { return { oAuthCallback: function(req,…
Dave Sag
  • 13,266
  • 14
  • 86
  • 134
4
votes
1 answer

Externaly Rejecting Pending Promises In Ember

Summary: We run into the following situation with our Ember app and are struggling to find an appropriate solution. We are dealing with a lot of data and hence some of our requests for data are rather slow. Initially we used Em.RSVP.hash to "bundle"…
3
votes
1 answer

Incremental loading of images with promises

I am trying to load same image but with different resolution, one by one, with 1.png first and then 2.png and then 3.png, with help of promises, but when i run the code, it loads only 3.png image, what am i doing wrong? function loadi(srce){ …
Dark Lord
  • 415
  • 5
  • 16
3
votes
1 answer

How to run qunit assertions on resolving a Promise

I am writing a test for a function that returns a promise, and am not able to run assertions on resolving or rejecting the promise. I cannot use ES6 on this project so I am using the rsvp.js library which claims to implement the Promises/A+…
carbontax
  • 2,164
  • 23
  • 37
3
votes
1 answer

Ember Data belongsTo async relationship omitted from createRecord() save() serialization

Edit 11/16/14: Version Information DEBUG: Ember : 1.7.0 ember-1.7.0.js:14463 DEBUG: Ember Data : 1.0.0-beta.10+canary.30d6bf849b ember-1.7.0.js:14463 DEBUG: Handlebars : 1.1.2 ember-1.7.0.js:14463 DEBUG: jQuery : 1.10.2 I'm beating my…
nckturner
  • 1,266
  • 1
  • 15
  • 19
3
votes
1 answer

Wrapping promise into a Sync function

I'm writing a node CLI where synchronous behaviour is typically more appropriate than async and I'd like to be able to leverage the following convention: # Write functional code as an async function which returns a Promise function foobar() { ...…
ken
  • 8,763
  • 11
  • 72
  • 133
3
votes
2 answers

How to deal with async properties in Ember when I need blocking calls?

We were using a model with a hasMany with embedded children. This was fine so that whenever I called model.get('children') everything just worked. We've now changed that children property to async:true, and I can't seem to find proper documentation…
andy
  • 8,775
  • 13
  • 77
  • 122
2
votes
1 answer

Manage Ember Multiple RSVP Promises on the same route

I am working with the GitHub API in order to load models in a specific route I am doing two promises one for my personal github details : https://api.github.com/users/user and the other one for my GitHub repositories…
Koala7
  • 1,340
  • 7
  • 41
  • 83
2
votes
1 answer

Ember.js - different promise classes

What is the difference between using: new RSVP.Promise() (docs) and new Promise() (docs) in an Ember app? Are they just aliases?
JDillon522
  • 19,046
  • 15
  • 47
  • 81
1
2 3 4