1.2.0 • Published 1 year ago

q-map-throttle v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

q-map-throttle

A utility for throttling Q promises created using map()

import Q from 'q';
import { map } from 'q-map-throttle';

Q.map = map

const myArray = [1,2,3,4,5,6,7,8]

// Limits promise concurrency to 3
Q.map(myArray, function(element) {
    return promiseFactory(element)
}, 3)
    .then(function(resolvedArray) {
        doSomething()
    })