neuroanatomy / BrainBox

BrainBox is a web application that lets you annotate and segment 3D brain imaging data in real time, collaboratively.
https://brainbox.pasteur.fr
Other
96 stars 46 forks source link

Change jQuery Promises into Ecma Promises #156

Closed r03ert0 closed 5 years ago

r03ert0 commented 6 years ago

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([]).

tulikavijay commented 6 years ago

I would like to work on this :)

r03ert0 commented 6 years ago

nice!

On Tuesday, October 17, 2017, Tulika notifications@github.com wrote:

I would like to work on this :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenNeuroLab/BrainBox/issues/156#issuecomment-337271372, or mute the thread https://github.com/notifications/unsubscribe-auth/ACNCTG--xqDN5_85KBoapA389n0t4o9Pks5stMzWgaJpZM4P8RT6 .

tulikavijay commented 6 years ago

can you review my PR please? i have to make more changes i would like to know if i am doing it right. Also i cant figure out how to convert this one : L296 thankyou.