1.5.3 • Published 9 years ago

prll v1.5.3

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Parallel

Runs a bunch of promises like Promise.all does, but takes an object instead of array.

Keep the differences:

Promise.all([foo(), bar(), baz(), qux()])
  .then(arr => magic(arr[2], arr[0], arr[1]));

vs

prll({foo: foo(), bar: bar(), baz: baz(), qux: qux()})
  .then(r => magic(r.baz, r.foo, r.bar, r.qux));

Or with es6:

prll({a: foobar(), b: bazqux()})
  .then(({a, b}) => magic(a, b));

Example

import 'prll' as parallel;

parallel(_.mapValues({
  questions: '/data/questions.json',
  cv: '/data/user/_cv.json'
}, url => $.ajax(url)))
  .then(({questions, cv}) => console.log(questions, cv));

Alternativies

1.5.3

9 years ago

1.5.2

9 years ago

1.5.1

9 years ago

1.5.0

10 years ago

1.4.0

10 years ago

1.3.0

10 years ago

1.2.0

10 years ago

1.1.3

10 years ago

1.1.1

11 years ago

1.1.0

11 years ago

1.0.0

11 years ago