Skip to content

Instantly share code, notes, and snippets.

@airburst
airburst / sequenceWithResultStore.js
Created June 13, 2018 11:11
Run an async queue of records through an action and store/use result of each
class TaskQueue {
constructor(concurrency = 1) {
this.concurrency = concurrency;
this.running = 0;
this.queue = [];
}
pushTask(task) {
this.queue.push(task);
this.next();