1.1.0 • Published 6 years ago
dopar v1.1.0
dopar
It runs many promises in parallel.
Installation
yarn install doparUsage
import dopar from 'dopar'
const lazyPromises = [
  () => oneSecondDelay(),
  () => oneSecondDelay(),
  () => oneSecondDelay(),
]
dopar(3, lazyPromises) // resolves after +-1 second instead of 3 seconds
dopar.forEach(3, lazyPromises) // resolves after +-1 second instead of 3 secondsThe difference between dopar and dopar.forEach is that the latter does not store any result in memory.