Questions tagged [rsvp.js]

A lightweight library that provides tools for organizing asynchronous code

RSVP.js provides simple tools for organizing asynchronous code.

Specifically, it is a tiny implementation of Promises/A+ and a mixin for turning objects into event targets.

It works in node.js and the browser.

97 questions
0
votes
1 answer

Method under test appearing in unit test other than in the action

I was wondering if anyone could give me some pointers on designing my unit tests, specifically where the function being tested appears in the test itself other than in the unit's action. I'm writing server side javascript with node and using rsvp…
ogginger
  • 433
  • 4
  • 11
0
votes
3 answers

Conditional promises in Ember.RSVP

I have a simple if else scenario where I need to do something if a variable is set otherwise just perform in the else part: if(flag) { doSomething(); } doNextThing(someParam); If flag is set, then I must doSomething() and doNextThing() Both…
MojoJojo
  • 3,897
  • 4
  • 28
  • 54
0
votes
1 answer

Ember search in current model

This code for search in hasMany childrens work like a charm. But i want search in current model (e.g. filtered by store name: 'storeOne'), that is reason because i want search in current model, not query to this.store and not query to api... …
iTux
  • 1,946
  • 1
  • 16
  • 20
0
votes
1 answer

RSVP.js promise running before .then() is called

I presume this is a basic mistake, but as my searches made no effect, let's do it here anyway :) I have a function returning a promise, but it runs so fast (because code is almost empty) that when .then() is called, it is too late and no event is…
Marinho Brandão
  • 637
  • 1
  • 9
  • 30
0
votes
1 answer

Best way to debug promises running in parallel

Am developing backend of an app using nodejs+express and using RSVP for promises. Problem : whenever there is an error or exception in one of the functions that is unexpected the execution is stuck. Is there any way i can find which one of the…
Steve
  • 19
  • 1
  • 1
  • 6
0
votes
2 answers

Why does my hash of promises resolve before passed promises resolve?

I have been using promises for a while, but now and then I stumble into problems that I cannot seem to resolve (no pun intended). I have an array of files for which I have to perform asynchronous functions call for each file to fetch some metadata.…
Daniel B
  • 8,770
  • 5
  • 43
  • 76
0
votes
0 answers

RSVP.all is not firing failure callback on ember-data save failure

I am wrapping a collection of saves in a Ember.RSVP.all aggregator promise and the failure callback is not firing when an individual failure triggers. I have also tried Ember.RSVP.allSettled. I am using ember-data's active model adapter plugin and…
xrl
  • 2,155
  • 5
  • 26
  • 40
0
votes
1 answer

Finally executes before last `.then` when using chained promises

How come my last .then (writeLin..) doesn't run? Note: triggercommand returns function that returns promise .then(function () { if (fs.existsSync(tempDir + '/' + repoName)) { return self.triggerCommand("git", ["checkout", "master"],…
SuperUberDuper
  • 9,242
  • 9
  • 39
  • 72
0
votes
1 answer

Javascript Asynchronous Function Chaining

I have a set of JavaScript functions on a Node server that are making HTTP requests to an external API. I'm trying to chain them. My HTTP request function returns a promise, so I've been trying to utilize .then(). var x = function(id){ //Passes…
thisisnotabus
  • 1,949
  • 3
  • 15
  • 31
0
votes
1 answer

Ember Select component rendering before promise is resolved

I have a component which adds some functionality to a has fully rendered including all
antony
  • 2,763
  • 19
  • 23
0
votes
1 answer

RSVP Promises: then() chain returning the first value of the chain

I'm currently trying to wrap some indexedDB code into promises. I have a "load db" function as: db.load = new RSVP.Promise( function ( fulfill , reject ) { //... if (globaldb) { fulfill(globaldb); return; } //... …
wkrueger
  • 1,281
  • 11
  • 21
0
votes
0 answers

Ember and RSVP: Promise from Model hook not available in template

I've got a simple rest service which provides a Route in my Ember app with some basic model data. Here is my attempt to make it available: model: function () { var promise = new Em.RSVP.Promise (function (resolve, reject) { var request =…
Doe Johnson
  • 1,374
  • 13
  • 34
0
votes
2 answers

How do I then() on a promise?

I'm using the RSVP.js lib in a browser. I have one promise applicationReady I have another promise loadSomeData I have a final promise, configureUI Each relies on the previous promise to do it's work. How do I get these three promises to run in…
Michael Cole
  • 15,473
  • 7
  • 79
  • 96
0
votes
1 answer

Try to get Javascript functions to run Synchronously

I'm having trouble with the following code snippet. My init method needs to run and complete the getLocation() function before the initializeMapp() and geoListen() can run. I have rsvp.js linked as a resource, but not quite sure how to implement. …
BanditX
  • 21
  • 3
0
votes
3 answers

reject handling in promises

The following code returns an RSVP promise from each getJSON method: getJSON('/login') .then(getJSON('/errors').then(function(users) { self.user = users; })) .then(getJSON('contacts').then(function(contacts) { self.contacts =…
dagda1
  • 26,856
  • 59
  • 237
  • 450