@speckle/objectloader2
Version:
This is an updated objectloader for the Speckle viewer written in typescript
29 lines • 746 B
JavaScript
export class MemoryDatabase {
items;
constructor(options) {
this.items = options?.items || new Map();
}
getAll(keys) {
const found = [];
for (const key of keys) {
const item = this.items.get(key);
if (item) {
found.push({ baseId: key, base: item });
}
else {
found.push(undefined);
}
}
return Promise.resolve(found);
}
cacheSaveBatch({ batch }) {
for (const item of batch) {
this.items.set(item.baseId, item.base);
}
return Promise.resolve();
}
disposeAsync() {
return Promise.resolve();
}
}
//# sourceMappingURL=memoryDatabase.js.map