d3/d3-queue

.progress() or .tick() method?

veltman opened this issue · 2 comments

I often end up including code to track a slow queue's progress with some sort of tick function in each task. Would a PR with this be useful or too bloaty?

I'd imagine something like a .progress(onComplete) method that takes an onComplete function that receives the number of tasks completed so far:

myQueue.progress(function(completed){  console.log(completed, "tasks completed"); });

Related #10 #16.

Gotcha - using d3-dispatch makes sense but would be adding a lot. Also maybe fun new wrinkles like missing a progress event if a task calls back synchronously before the listener is added...