That makes sense. I was sort of hung up on the fact that the counter would have to be kept outside the function and was thinking that might screw up somehow  if the function were called multiple times. But the render promise array is already global, so if there's some reentrancy problem, we already have it. 

I'll take a look at simplifying this weekend.