How to use the settle function from when
Find comprehensive JavaScript when.settle code examples handpicked from public code repositorys.
GitHub: namgk/dnr-editor
100 101 102 103 104 105 106 107 108 109
} else { callback.call(node); } } if (promises.length > 0) { return when.settle(promises).then(function() { if (this._context) { return context.delete(this._alias||this.id,this.z); } });
14
73
0
197 198 199 200 201 202 203 204 205 206
describe("uninstalls module", function() { it("rejects invalid module names", function(done) { var promises = []; promises.push(installer.uninstallModule("this_wont_exist ")); promises.push(installer.uninstallModule("this_wont_exist;no_it_really_wont")); when.settle(promises).then(function(results) { results[0].state.should.be.eql("rejected"); results[1].state.should.be.eql("rejected"); done(); });
14
73
0
GitHub: namgk/dnr-editor
208 209 210 211 212 213 214 215 216 217
} else { promises.push(when.resolve(r)); } }); var i=0; when.settle(promises).then(function(res2) { var result = {}; res2.forEach(function(r) { // TODO: name||fn if (r.value.fn) {
14
73
0
60 61 62 63 64 65 66 67 68 69
} } else { console.log(">> No default credentials found"); } */ when.settle(promises).then(function() { resolve(); }); } else { resolve();
11
4
0
122 123 124 125 126 127 128 129 130 131 132 133
// project.paths.credentialsFile = fspath.join(project.path,"flow_cred.json"); // } promises.push(project.loadRemotes()); return when.settle(promises).then(function(results) { return project; }) }); };
1
3
0
+ 2 other calls in file
26 27 28 29 30 31 32 33 34 35 36 37
function registerMessageCatalogs(catalogs) { var promises = catalogs.map(function(catalog) { return registerMessageCatalog(catalog.namespace,catalog.dir,catalog.file); }); return when.settle(promises); } function registerMessageCatalog(namespace,dir,file) { return when.promise(function(resolve,reject) {
1
3
0
26 27 28 29 30 31 32 33 34 35
if (!username || !password) { response.status(400).send('please add username and password on your post request'); return; } const [getJsession, getSmsession] = await when.settle([ axios('https://portalprepagos.cgd.pt/portalprepagos/login.seam', { method: 'get' }), axios('https://portalprepagos.cgd.pt/portalprepagos/auth/forms/login.fcc', {
0
2
0
GitHub: vektoririna/tasks
160 161 162 163 164 165 166 167 168 169
* roles_users */ // Write changes to DB, if successful commit, otherwise rollback // when.all() does not work as expected, when.settle() does. when.settle(ops).then(function (descriptors) { var rej = false, error = ''; descriptors.forEach(function (d) { if (d.state === 'rejected') {
0
0
0