@speckle/objectloader2
Version:
This is an updated objectloader for the Speckle viewer written in typescript
32 lines • 950 B
JavaScript
export default class AsyncGeneratorQueue {
add(value) {
if (this.
// If there's a pending consumer, resolve immediately
const resolve = this.
resolve(value);
}
else {
// Otherwise, add to the buffer
this.
}
}
async *consume() {
while (!this.
this.
this.
if (this.
yield this.
}
else {
yield await new Promise((resolve) => this.
}
}
}
dispose() {
this.
}
}
//# sourceMappingURL=asyncGeneratorQueue.js.map