1.5.3 • Published 7 years ago

prll v1.5.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 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

7 years ago

1.5.2

7 years ago

1.5.1

7 years ago

1.5.0

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.1.3

8 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago