Change jQuery Promises into Ecma Promises
Created by: r03ert0
Is this a feature request or a bug report?
This is an enhancement request
What is the current behaviour?
Currently brainbox uses jQuery promises, which look like this:
function foo() {
var def = new $.Deferred();
if(result_of_async_process_is_ok) {
def.resolve();
} else {
def.reject();
}
return def.promise();
}
What is the expected or desired behavior?
Use standard ES promises, which look like:
functio foo() {
var pr = new Promise(function(resolve, reject) {
if(result_of_async_process_is_ok) {
resolve();
} else {
reject();
}
return pr;
});
Other than that, brainbox uses the $.when promises, which should be replaced with Promise.all([]).