angular-queue
angular-queue copied to clipboard
Suggestion: add option to 'wait' for callback before applying the delay
Hi,
I'm using the queue not to flood the server with requests but sometimes requests take longer than delay. A good change would be to add an option to wait for a promise returned by the callback to be resolved before 'applying' the delay. something like this in this.start would work?
var res = _this.callback.call(_this, item); $q.when(res).then(function () { timeoutProm = $timeout(loopy, _this.delay); })