Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function* batches(volume, batchSize) {
- let parts = Math.ceil(volume / batchSize)
- for (let i = 0; i < parts; i++) {
- yield { value: Math.min(volume, batchSize), index: i }
- volume -= batchSize
- }
- }
Add Comment
Please, Sign In to add comment