RSVP/Promise - is there any difference?

Hello,

Is there any difference between these two Promise under the hood? Are both cases using Ember.RSVP?

 return Ember.$.getJSON('https://apixx.com/mypayload.json').then(function(data) {
      return data.splice(0, 3);  
});
var promise = new Ember.RSVP.Promise(function(resolve) {
  $.getJSON('https://apixx.com/mypayload.json').then(function(data){
   resolve(data);
  });
});

promise.then(function(data) {
  return data.splice(0, 3);  
});

They are not the same. JQuery is a .promise() | jQuery API Documentation and ember is using GitHub - tildeio/rsvp.js: A lightweight library that provides tools for organizing asynchronous code

I think RSVP.Promise has some extras that the jquery promise implementation doesn’t have. Also it used to be the case that JQuery promises were not really proper promises in the way they handled chaining but that maybe fixed now.

Wrapping a JQuery “promise” in an Ember.RSVP.Promise does not give you the correct error handling of a promise. I recommend you use the ic-ajax library. This is available via the Ember addon ember-cli-ic-ajax.