Lag helps with functional promises.


Functional promises. It's like lodash/underscore for promises.

Using promises as functional values allows the developer to write asynchronous code in a synchronous way.

Method signature

lag.methodName(function, promise_array)

Lag uses the "function first" method signature in order to take advantage of the functional approach to programming.

If you prefer the put the values first and the method second, you can call the lag.promiseFirst() method to switch the parameter order to lag.methodName(promise_array, function).


npm install lag --save


bower install lag --save
var _ = require('lag');
var xhr = require('xhr');
var promises = [
  _.promise(function (resolvereject) {
    http.get('', function (errres) {
      if (err) return reject(err);
];, promises)
.then(function (values) {
    // values === [124] 
npm install
npm run build
npm install
npm test