I've to manage a project made with Backbone.js. The project was first released in 2013. At the moment I try to figure out what they did before.
I found out that they use quite often the Promise.js libery to communicate with the ReST-Server like the example underneath
run: function () {
if (this.initialAppViewMethod) {
Promise.resolve(this.model.get('session').fetch())
.catch(this.showLoginView.bind(this))
.then(this.initMainView.bind(this));
}
},
I've been wondering if there is a certain reason why they have used Promise.js instead the already used jquery.js liberay to do promises?
BTW: How can I convert this script to use pure jQuery functionallity?