Skip to content

Instantly share code, notes, and snippets.

@stevekane
Last active December 27, 2015 19:19
Quick sketch of RSVP.Hash wrapper
model: function (params) {
var FetchPromise = Ember.RSVP.Promise(function (resolve, reject) {
Ember.RSVP.hash({
dinosaurs: App.Dinosaur.find(),
ninjas: App.Ninja.find()
})
.then(function (objects) {
resolve(objects);
})
.fail(function (errors) {
//handle errors here and call resolve on YOUR terms.
//Perhaps you could recall FetchPromise
//Perhaps you could just resolve with empty arrays.
})
})
return FetchPromise;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment