chembl / curation-interface

This is repository to track all bugs and issues related to development of the curation interface
0 stars 0 forks source link

Use underscore.js to handle promises better. #96

Open mnowotka opened 9 years ago

mnowotka commented 9 years ago

There is a problem with promise implementation in jQuery.js I described here: https://stackoverflow.com/questions/15837964/not-asynchronous-function-executed-as-jquery-deferred.

The solution is to use:

 setTimeout(dfd.notify,0);

But this makes code less readable. This should be replaced with:

_.defer(dfd.notify);

which better explains it's purpose.