@speckle/objectloader2
Version:
This is an updated objectloader for the Speckle viewer written in typescript
30 lines • 769 B
JavaScript
export class MemoryPump {
#items = new Map();
add(item) {
this.#items.set(item.baseId, item);
}
async pumpItems(params) {
const { ids, foundItems, notFoundItems } = params;
for (const id of ids) {
const item = this.#items.get(id);
if (item) {
foundItems.add(item);
}
else {
notFoundItems.add(id);
}
}
return Promise.resolve();
}
async *gather(ids) {
for (const id of ids) {
const item = this.#items.get(id);
if (item) {
yield item;
}
}
return Promise.resolve();
}
async disposeAsync() { }
}
//# sourceMappingURL=memoryPump.js.map