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
2
votes
2 answers

Uncaught ReferenceError: RSVP is not defined , error while using require.js with rsvp

I am working on a demo showing the error handling in promises using rsvp.js. Everything seemed fine, till I used the CDN url for rsvp.js in a tag. Now since I have require.js for module loading in my application, I tried loading the rsvp.js module…
VishnuNair
  • 121
  • 4
  • 12
2
votes
1 answer

RSVP.js - Multiple asynchronous function calls on array

I have a result from a REST call that contains a list of files. Each file has properties that I have to extract and place in a new array. This is straightforward and is easily done with a simple loop. Three of the properties I need to extract are…
Daniel B
  • 8,770
  • 5
  • 43
  • 76
2
votes
1 answer

Ember.RSVP.All error Array Methods must be provided an Array

Cross-posted from discuss.emberjs.com I'm trying to save a model then upon successful save save some additional models related to the intial model. These are in standard input fields that I can't/don't know how to bind to ED so I'm just using…
ultimatemonty
  • 211
  • 1
  • 13
2
votes
1 answer

How to chain a RSVP promise and return the original reject/success functions?

I have a simple rsvp helper that lets me wrap an ajax call as a simple promise var PromiseMixin = Ember.Object.create({ promise: function(url, type, hash) { return new Ember.RSVP.Promise(function(resolve, reject) { …
Toran Billups
  • 27,111
  • 40
  • 155
  • 268
2
votes
3 answers

nodeJS / Express: what's wrong with this RSVP promise?

I'm using nodeJS, running express4 framework to create an API. I am using RSVP.js for promises. worker.getFamilies is called by an external module, not reflected here. The caller expects back an object with results. Inside worker.getFamilies: - I am…
quelquecosa
  • 890
  • 1
  • 10
  • 24
2
votes
0 answers

Have Ember.ArrayController render an array of promises

Ember controllers are promise-aware, in that the model can be a promise. For an ArrayController you could have a promise to an array, but what if you have an array containing promises? See this JSFiddle for an example http://jsfiddle.net/7QSZ6/ Why…
Arne Brasseur
  • 1,468
  • 13
  • 18
2
votes
1 answer

handle RSVP.Hash errors from model hook

Say I am returning an RSVP.Hash from a model hook like this: model: function() { hash = { users: App.User.find(), contacts: App.Contact.find() }; return Ember.RSVP.hash(hash); } This works fine for me in the good case but what about…
dagda1
  • 26,856
  • 59
  • 237
  • 450
2
votes
1 answer

Building Model object from multiple rest calls

I have a route like following where it builds the data from multiple rest calls. App.IndexRoute = Ember.Route.extend({ model: function() { var id = 1; //will get as url param later var modelData = {ab:{},ef:{}}; return…
thecodejack
  • 12,689
  • 10
  • 44
  • 59
2
votes
1 answer

Handling promise rejection in ember-data with findQuery()

I cannot seem to get ember-data to reject failed (404's) when using findQuery(..query..); find(..id..); works fine. So in the route: App.PostRoute = Ember.Route.extend({ serialize: function(model, params) { return { post_id: model.get('slug')…
i0n
  • 916
  • 1
  • 8
  • 26
2
votes
1 answer

RSVP is not chaining 'then' properly

Am I doing something wrong? According to the documentation RSVP.all is supposed to return a promise. And all promises support chainable 'then's. In this example: http://jsbin.com/epuxod/3/edit the first 'then' calls the failed callback properly, but…
bcardarella
  • 4,667
  • 4
  • 29
  • 45
1
vote
1 answer

How to iteratively save child records in Ember.js?

I want to save a parent record and multiple child records to an external REST API using Ember Data. The problem I have is that I'm not sure what the best way to handle this asynchronously. My first attempt looked something like this: let parent =…
DJ_Beardsquirt
  • 289
  • 5
  • 14
1
vote
1 answer

Angular POS Print Issue

My requirement: Print without print preview angular 6 Only solution i found Angular 2 Raw Printing Service I am using think link for Angular POS print Do i have any other alternatives? .ts code printInvoice() { …
Coder
  • 359
  • 1
  • 7
  • 14
1
vote
1 answer

AJAX call inside Ember.RSVP.Promise

I have the following common code to invoke AJAX requests. My question is if the "return" keyword is necessary for the $.ajax (since doing $.ajax would anyways return a promise) OR if it is for some other purpose ? doXhr: function(postData,…
copenndthagen
  • 49,230
  • 102
  • 290
  • 442
1
vote
1 answer

EmberJs Promises - Now to make .map() or .forEach() asynchronous?

Here is my controller action: saveArticle(article, blocks) { let self = this; return RSVP.all(article.get('blocks').invoke('destroyRecord')).then(function () { blocks.data.map(function (item) { let block =…
1
vote
3 answers

qz-tray sha-256 not defined

I am trying to print the simple data text using Angular and Qz-Tray. But everytime I try to Print the error is displayed: qz-tray.js:35 ReferenceError: Sha256 is not defined at Object.hash (qz-tray.js:408) at…