How to use the lie.all function in lie

To help you get started, we’ve selected a few lie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github petkaantonov / bluebird / benchmark / madeup-parallel / promises-calvinmetcalf-lie.js View on Github external
module.exports = function upload(stream, idOrPath, tag, done) {
    var queries = new Array(global.parallelQueries);
    var tx = db.begin();

    for( var i = 0, len = queries.length; i < len; ++i ) {
        queries[i] = FileVersion.insert({index: i}).execWithin(tx);
    }

    Promise.all(queries).then(function() {
        tx.commit();
        done();
    }, function(err) {
        tx.rollback();
        done(err);
    });
}
github pouchdb / geopouch / index.js View on Github external
});
          case 'MultiPolygon':
            return doc.coordinates.forEach(function (coord) {
              emit({
                type: 'Polygon',
                coordinates: coord
              });
            });
          case 'GeometryCollection':
            return doc.geometries.forEach(fixMulti);
          default:
            return emit(doc);
          }
        }
        func(doc, fixMulti);
        return Promise.all(emited);
      }
      var lastSeq;
github calvinmetcalf / fileGDB.js / lib / browserReader.js View on Github external
}).then(function(names) {
      var out = {};
      return Promise.all(Object.keys(names).map(function(key) {
        return readFile(names[key]).then(function(v) {
          out[key] = v;
        });
      })).then(function() {
        return out;
      });
    }).then(yes, no);
  });
github pouchdb / geopouch / index.js View on Github external
}).on('error', reject).on('end', function () {
        resolve(Promise.all(promises).then(function () {
          return Object.keys(out).map(function (id) {
            return out[id];
          });
        }));
      });
    });
github pouchdb-community / transform-pouch / dist / pouchdb.transform-pouch.js View on Github external
handlers.bulkDocs = function (orig, args) {
    for (var i = 0; i < args.docs.length; i++) {
      args.docs[i] = incoming(args.docs[i]);
    }
    return Promise.all(args.docs).then(function (docs) {
      args.docs = docs;
      return orig();
    });
  };
github pouchdb / geopouch / store.js View on Github external
Store.prototype.batch = function(array, cb) {
  var self = this;
  return Promise.all(array.map(function (item) {
    return new Promise(function (resolve, reject) {
      function callback(err, value) {
        if (err) {
          reject(err);
        } else {
          resolve(value);
        }
      }
      if (item.type === 'del') {
        return self.del(item.key, callback);
      }
      return self.put(item.key, item.value, callback);
    });
  })).then(function () {
    cb();
  }, cb);
github calvinmetcalf / fileGDB.js / lib / nodeReader.js View on Github external
return getNames(pathString).then(function(names){
    var out = {};
    return Promise.all(Object.keys(names).map(function(key){
      return readFiles(path.join(pathString, names[key])).then(function(v){
          out[key] = v;
        });
    })).then(function(){
      return out;
    });
  });
};
github pouchdb / add-cors-to-couchdb / index.js View on Github external
function doCouch1(baseUrl, auth) {
  return Promise.all(requests.map(function (req) {
    var urlString = formatUrl(baseUrl, auth, req.path);
    return updateConfig(urlString, req.value);
  }));
}

lie

A basic but performant promise implementation

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis